Remote Drive Mappings

(imported topic written by Steve91)

Hi Chaps,

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.

Any help much appreciated.

Cheers

Steve

(imported comment written by brolly3391)

Cheerio Steve

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)

A: \SERVER\share$

A: \server2\Share2

A: \Server3\Share3$

A: \SERVER\SHARE2

Cheers,

Brolly

(imported comment written by Steve91)

Thanks Brolly that works a treat.

Although, is there any way it can report the drive letter of the mapped drive and not the actual path?

Cheers

Steve

(imported comment written by Steve91)

Sorry, just answered it myself (should have looked before I leapt!) :slight_smile:

Used “Caption” instead of “ProviderName”

Although it returns all drives and not only remote mappings it still gives me a picture of all the “unavailable” drive letters.

Cheers

Steve

(imported comment written by brolly3391)

Oh,

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.

Cheers,

Brolly

(imported comment written by Steve91)

Fantastic!

Exactly what I was looking for.

The inspector is quicker.

Thanks again Brolly

Steve

*/makes mental note to read the inspector library in full…

(imported comment written by neilhenderson)

Hi

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.

Regards

Neil

(imported comment written by neilhenderson)

Hi

We have been supplied this solution by our suppliers (Satisnet, UK) Via Bigfix Support

(substring after “=” of (property “Caption” of it as string) & " - " &

substring after “=” of (property “Providername” of it as string)) of

select objects "Caption, Providername from WIN32_LogicalDisk where

Providername != NULL" of WMI as string

They have also modified the WMI query to only return when there is a mapped

path present on a drive letter.

Now shows multiple results box for each machine but with letter in front

E: - \MHG_HO\SYS1

etc…

and in the filter and reports we can see the mess we have created for ourselves with multiple mappings for the same drive letter.

Regards

Neil