i.kulgu wrote:You can do this with a vbscript.
Get the script below and copy it to your actionpath.
Make a computer action like : {actionpath}driver_mapping.vbs
That should do the trick.
Ps. if you can change the script where you can get all the outputs in 1 screen would work better, i couldn't manage to do that.
The following may do what you wanted.. I noticed in your script that you'd set "Connect" but not used it so it only ever returned the mapped drives of the local PC, not the remote PC... anyway... Save the following as "Drive_Mapping.vbs"
Code:
CompName = wscript.arguments.Item(0)
set wshShell=CreateObject("wscript.shell")
Set objWMI = GetObject("winmgmts:\\" & CompName & "\root\cimv2")
Set oDrives = objWMI.ExecQuery("select * from Win32_MappedLogicalDisk")
strTitle="Network Drive Mappings"
strmsg="Drive Mappings on " & CompName & vbcrlf & vbcrlf
For Each objDrive in oDrives
strMsg=strMsg & ObjDrive.DeviceID & " " & objDrive.ProviderName & vbcrlf
Next
wshShell.Popup strMsg,-1,strTitle,vbinformation
and add your custom action as.... {actionpath}Drive_Mapping.vbs {computer}
Note that this can sometimes take a while to enumerate the "objDrive.ProviderName"