I'd like to use WMI to retrieve all logical disks from a remote host. For some unknown reason, running
get-wmiobject Win32_LogicalDisk -computername remoteHost fails to include network drives located on the remote Windows host. However, running
get-wmiobject Win32_LogicalDisk locally on
remoteHost successfully retrieves all logical disks, network drives included.
For example, running the command locally retrieves all logical disks (output formatted for clarity):
>get-wmiobject Win32_LogicalDisk DeviceID : A: DriveType : 2 DeviceID : C: DriveType : 3 DeviceID : D: DriveType : 5 DeviceID : S: // this is a network drive DriveType : 4 ProviderName : \\path\Share
However, running the same command remotely fails to retrieve network drive S:
>get-wmiobject Win32_LogicalDisk -computername remoteHost -credential DOMAIN\Admin DeviceID : A: DriveType : 2 DeviceID : C: DriveType : 3 DeviceID : D: DriveType : 5
The same happens if I use WinRM. The remote host is running Win Server 2012 R2. The result is the same no matter what OS I run the command on (Win7, Win Server 2008 R2, Win Server 2012 R2).
Any ideas what may be causing the network drive(s) to be omitted from the result set?