windowspowershellwmiwmi-query

Is there any way to check if a (UNC path) volume is a Windows DedupVolume or not?


I wanted to find out if a given volume has Data Deduplication enabled or not.


For a local volume this is straightforward using the WMI query:

select * from MSFT_DedupVolume where Volume='E:\\MountFolder\\DedupVolume'


But for a UNC path as volume name, the WMI query returns nothing (no error, just blank output).

select * from MSFT_DedupVolume where Volume='\\\\windowsMachine\\E$\\MountFolder\\DedupVolume'


In wmi-access-to-unc-paths it is mentioned that

WMI operations are not allowed to access network resources due to security restrictions in Windows.

Is there any other way to find out if a UNC path volume has Data Deduplication configured or not?


Solution

  • I figured out a way to solve the problem.

    As the computer name (windowsMachine) and the local volume name on that machine (E:\\MountFolder\\DedupVolume) are available from the unc path \\\\windowsMachine\\E$\\MountFolder\\DedupVolume, it is possible to get the MSFT_DedupVolume information using the powershell command:

    Get-WmiObject -Query "select * from MSFT_DedupVolume where Volume='E:\\MountFolder\\DedupVolume'" -Namespace 'root/microsoft/windows/deduplication' -ComputerName 'windowsMachine'