#159224 - 2006-03-16 09:11 PM
Re: Using If In Group
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
How many group/directories do you have?
we can work on optimizing the code once you get something working. At this point you can repeat the code Les gave you. Change $Whatever to the group name in each case.
|
|
Top
|
|
|
|
#159226 - 2006-03-16 09:44 PM
Re: Using If In Group
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I would then use the UDF DirPlus or something similar to get an array of directories. then... untested Code:
$UNC = "\\server\share" $dirArray = dirplus($UNC,"/ad")
for each $dir in $DirArray $Group = 'TNT\' + $dir If InGroup($Group) Use R: $Server1 + $dir EndIf next
Actually I would use one of the MapDrive UDF for the actual mapping.
|
|
Top
|
|
|
|
#159227 - 2006-03-16 09:45 PM
Re: Using If In Group
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11628
Loc: CA
|
Well sorry, but I see no way around it. Also, there are only drives up to Z unless you do drive mounting.
How to create and use NTFS mounted drives in Windows XP http://support.microsoft.com/kb/307889 You could use a .ini file to do the read group stuff but not much different than having it in the code
If InGroup('MyDomain\AA) USE USE E: "\\SERVER\AA" EndIf If InGroup('MyDomain\BB) USE USE E: "\\SERVER\BB" EndIf
and so on and so on.
If you don't want to do it in script then at the machine map it as a persistent drive and don't deal with it in the script. The OS will map it each time it logs on for that user.
|
|
Top
|
|
|
|
#159229 - 2006-03-16 09:47 PM
Re: Using If In Group
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Actually you may want to Code:
for $x=0 to ubound($DirArray) $Group = 'TNT\' + $dir If InGroup($Group) MapDrive ... $x=ubound($DirArray)+1 EndIf next
This would keep the rest of the group checks from taking place once a match is found.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1003 anonymous users online.
|
|
|