#33319 - 2002-11-25 05:53 PM
Re: Script not running....
|
Nick O'Connor
Fresh Scripter
Registered: 2002-11-22
Posts: 12
|
What does the 0 or 1 do?
And does the IN GROUP work for AD?
It doesn't seem to....
|
|
Top
|
|
|
|
#33322 - 2002-11-25 07:30 PM
Re: Script not running....
|
Nick O'Connor
Fresh Scripter
Registered: 2002-11-22
Posts: 12
|
Here is the latest.
? "Creating local user environment....." use h: /delete /persistent use h: '\\server\'+@USERID+'$$' IF InGroup("UserGroup") USE P: '\\server\'share' USE S: '\\server\'share2' Endif EXIT
The P and S drive mappings are not working.
It is the lateset version of Kix, and the AD group is a simple Global Security Group, which lives a few OU's down from the root.
|
|
Top
|
|
|
|
#33323 - 2002-11-25 07:35 PM
Re: Script not running....
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
You have too many quotes in the share name.
'\\server\'share'
should be: '\\server\share'
|
|
Top
|
|
|
|
#33324 - 2002-11-25 07:38 PM
Re: Script not running....
|
Nick O'Connor
Fresh Scripter
Registered: 2002-11-22
Posts: 12
|
oh man.....
Sometimes your just to close to a problem.
Thanks, I'll try that now.
|
|
Top
|
|
|
|
#33325 - 2002-11-25 08:00 PM
Re: Script not running....
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Now that you have a working Kix script...
You can add the MapDrive UDF to your code if you like and then use: code:
MapDrive($Drive, $Server, $Share) MapDrive("P:", "Venus", "Data")
The function takes care of making sure any exisiting mapping using the drive letter is deleted, mapping the drive, checking the success or failure, reporting the status, and logging the mapping/status if you include the Writlog UDF.
|
|
Top
|
|
|
|
#33326 - 2002-11-25 08:26 PM
Re: Script not running....
|
Nick O'Connor
Fresh Scripter
Registered: 2002-11-22
Posts: 12
|
code:
If @Homeshr<>"" Dim $x $x=Substr($Homeshr,3,len($Homeshr)-2) $Hserver=Substr($x,1,instr($x,"\")-1) $UserShare=Substr($x,instr($x,"\")+1,len($x)-instr($x,"\")) Endif If $HomeDrive<>"" and $Hserver<>"" and $UserShare<>"" MapDrive($HomeDrive, $Hserver, $UserShare)else Writelog("Home drive is either not defined or improperly defined for this user: Drive='" + $HomeDrive + "', Server='" + $Hserver + "', Share='" + $UserShare + "'") endif Function MapDrive($Drive, $Server, $Share) Dim $Drive, $Server, $Share Color c+/n If $Drive<>"" and $Server<>"" and $Share<>"" $LogText="Connecting $Drive to \\$Server\$Share" ? $LogText USE $Drive /Delete /Persistent USE $Drive "\\$Server\$Share" If @error=0 color g+/n $x=" - Success" "$x" Else color r+/n $x=" - Failed: Error @error" "$x" $ErrorState=1 Endif WriteLog ($LogText + $x) Color w+/n Else WriteLog ("Function 'MapDrive' called with invalid parameters: '$Drive', '$Server', '$Share'") Endif Endfunction ; ;And THEN put in ;
IF InGroup("UserGroup") MapDrive("P:", "Venus", "Data") Endif
????
{edit} Added code tags. - Bullock [ 25. November 2002, 21:16: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#33328 - 2002-11-25 08:49 PM
Re: Script not running....
|
Nick O'Connor
Fresh Scripter
Registered: 2002-11-22
Posts: 12
|
Nice, thanks. You guys have been great.
The only issue I have left is the 8 chaecter limit.
It all works great if the group name I am querying, and the share name I am connecting to are 8 charecters or less.
Otherwise, doens't seem to like it.....
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 476 anonymous users online.
|
|
|