Jump to content

Help: Show mapped drives for a remote user


Recommended Posts

Posted

Im trying to get some info on what drives are mapped for users that are currently logged on.

 

here is the script which works fine when im logged in but when i change the STRCOMPUTER = "Name of computer" it dont work.

 

Can someone help me out please.

 

Thanks

 

Tim

 

strComputer = "."

 

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

 

Set colDrives = objWMIService.ExecQuery _

("Select * From Win32_LogicalDisk Where DriveType = 4")

 

For Each objDrive in colDrives

Wscript.Echo "Drive letter: " & objDrive.DeviceID

Wscript.Echo "Network path: " & objDrive.ProviderName

Next

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...