Is it possible to check for the presence of remotely mapped drives?
For instance, if I run psinfo -d \servername against one of our servers it will show me the fixed drives but it also shows me the remote drive mappings (even though no-one is logged into the server)
I’m running a vbscript across our servers which maps a drive to a central location to write out it’s results.
I need to find a common drive across all the servers that isn’t fixed or remote and was hoping to set this up as a retrieved property.
I wish there was a way to get the name of a network drive using the inspectors. If there is, I could not find it.
I had to use WMI to get that information and thus the response time is slow.
Here is a quick and dirty way to get what you want:
q: exists (substrings after “=” of (selects “ProviderName from WIN32_LogicalDisk” of WMI as string as lowercase)) whose( it contains ("\server\share$" as lowercase))
A: True
T: 38.412 ms
I: singular boolean
based from this:
q: substrings after “=” of (selects “ProviderName from WIN32_LogicalDisk” of WMI as string)
I thought you were looking for a specific \server\share mapped to any drive letter. To get the drive letters that are mapped without regard to the UNC that they are mapped to you can do this instead:
All drive letters that are taken, mapped or physical:
q: names of drives
A: C:
A: D:
A: G:
A: H:
A: L:
A: O:
T: 0.157 ms
I: plural string
Only mapped drives:
q: names of drives whose (type of it = “DRIVE_REMOTE”)
A: G:
A: H:
A: L:
A: O:
T: 0.378 ms
I: plural string
Check the evaluation time vs the WMI version. That is why the inspectors should always be the first choice for relevance.
The WMI solution here is what I need but I would like to have the Caption on the same line as the Providername if that is possible. We have a mixture of NT, Novell and local mappings which are a complete mess and people have done there own thing outside the scripts, it would be great to see who has what mapped where.