I have been digging around in the agent itself, and also trying to generate a report that would give me this info, without having to login to each PC. Am I missing something fundamental? I would think this would be a basic reporting function, but I am not having any luck, help please!
You need to write a script that runs as user, then do this execute shell command:
net use >> #temp#\networkdrives.txt
Note: I did the double pipe which is a single pipe in a Kaseya script. Also note you will need to sort out the temp variable. You can then do a get variable or get file for the file content of #temp#\networkdrives.txt, and you can then email that to somewhere or upload to the Kasyea server using Get File, or perhaps dump it to the script log - all up to you.
The best solution I have found is a script to export mapped drives to a text file, and then you can work with it from there a little bit.
Dont forget that mapped drives are user dependant, so could be different depending on who is logged in to the workstation. You will need to have a waitfor login loop to make sure that the Procedure only attempst to run if someone is logged in.
Thanks Chris, this worked great.... any idea how to grab networked printers in a similar fashion?
I use a .vbs script to do this.. I call this from a script - then I put the results into the script log or upload to that agent...
on error resume next
Const ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile ("c:\temp\drivemap.txt", ForAppending, True)
Set objWMIService = GetObject("winmgmts:\\localhost\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_MappedLogicalDisk")
For Each objItem in colItems
Provider = Trim(Replace(objItem.ProviderName, "\\", ""))
a=Split (Provider,"\", 2)
objTextFile.WriteLine objItem.DeviceID & "\" & a(1) & " on " & a(0)
the output is a file C:\temp\drivemap.txt
the output file looks like
H:\sn\share on server5
I:\sharename on server5
J:\sn on server5
K:\sn\share on server5
M:\sharename on server7
P:\sharename on server5
V:\sharename on server7
its a nice little script