I'm writing a little powershell script for some basic logs that have to be generated. Right now I'm stuck with logging mapped network drives:
$colDrives = Get-WmiObject Win32_MappedLogicalDisk -ComputerName localhost
foreach ($objDrive in $colDrives) {
$array += $objDrive.DeviceID + $objDrive.ProviderName
}
This code works fine with mounted network drives that are connected. But I'm more interested in mapped drives that are not working. A net use on a cmd prompt shows me a status column, I'd like to have this too in a similar way
Z:\server\path should be Z:\server\path (ok|dead)
Regards, Alessandro