Page 1 of 1 1
Topic Options
#185322 - 2008-02-13 07:29 PM get mapped drives
Niro Offline
Fresh Scripter

Registered: 2003-07-15
Posts: 41
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


Edited by Niro (2008-02-13 07:30 PM)

Top
#185328 - 2008-02-13 09:53 PM Re: get mapped drives [Re: Niro]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
Loc: CA
There are pre-coded UDFs that can do that for you already.

UDF Forum


Top
#185330 - 2008-02-13 09:59 PM Re: get mapped drives [Re: NTDOC]
Niro Offline
Fresh Scripter

Registered: 2003-07-15
Posts: 41
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...
Top
#185342 - 2008-02-14 09:59 AM Re: get mapped drives [Re: Niro]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
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.

Top
#185348 - 2008-02-14 11:58 AM Re: get mapped drives [Re: Richard H.]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
To get the SID, maybe you cold use GetSid() or one of the Name2Sid() functions at http://www.kixtart.org/udf/
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 515 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.057 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org