|
|
|||||||
I'm trying to create a script to get all the mapped drives on all our machines...I can get all the machine names using the newview2 function (and run through it using a for loop)...but how would I get the drive mappings on the machines? It would look something like this: for each $computer in netview2("domain") $drives = getmappeddrives if open(4, "c:\drives.txt",5)=0 writeline(4, $drives + " " + $computer) EndIf next Thanks! -Mike |
||||||||
|
|
|||||||
There are pre-coded UDFs that can do that for you already. UDF Forum |
||||||||
|
|
|||||||
I see one that will get it for the local machine, but not remote machines. I guess it would need to get the mapped drives for the currently logged on user since they're profile based... |
||||||||
|
|
|||||||
You can read the "\\{computer}}\HKEY_USERS\{sid}\Network" key to find drive mappings. Depending on what you are trying to do you may get away with enumerating all the SIDs - otherwise you will need to identify which one you are interested in. |
||||||||
|
|
|||||||
To get the SID, maybe you cold use GetSid() or one of the Name2Sid() functions at http://www.kixtart.org/udf/ |