Page 1 of 1 1
Topic Options
#115797 - 2004-03-10 12:03 PM Need help with multiple InGroup and drive mapping.
Detector Offline
Fresh Scripter

Registered: 2004-03-10
Posts: 6
Hi All!

Ok i'm new so be gentle. I'm also new to Kixtart scripting.
I'm needing a script that will check for the users group(InGroup no problem) and map drive(s) accordingly. Right now I use the

Select
Case InGroup("\\RDC\GroupName")
Use K: /del
Use K: "\\Server\Folder"
Case 1
;No Drive K for you
EndSelect

Select
Case InGroup("\\RDC\GroupName2")
Use H: /del
Use H: "\\Server\Folder2"
Case 1
;No Drive H for you
EndSelect

Problem is the user may belong to both group K & H and need both drives mapped. This is the only way I have figured out to make it work. Is there a better way to check and map drives for my users that may need multiple drives mapped?

Thanks.

Top
#115798 - 2004-03-10 12:24 PM Re: Need help with multiple InGroup and drive mapping.
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Search the board for elaborate solutions which use INI files for mapping, but depending on how your groups are structured one of these should fit:

Code:
Use K: /DELETE

Use H: /DELETE

Select
Case InGroup("\\RDC\GroupName")
Use K: "\\Server\Folder"
Case InGroup("\\RDC\GroupName2")
Use H: "\\Server\Folder2"
Case InGroup("\\RDC\GroupName3")
Use K: "\\Server\Folder"
Use H: "\\Server\Folder2"
Case "True"
; No drive mapping for this group.
EndSelect



OR

Code:
Use K: /DELETE

Use H: /DELETE

If InGroup("\\RDC\GroupName")
Use K: "\\Server\Folder"
EndIf
If InGroup("\\RDC\GroupName2")
Use H: "\\Server\Folder2"
EndIf
If InGroup("\\RDC\GroupName3")
Use K: "\\Server\Folder"
Use H: "\\Server\Folder2"
EndIf


Top
#115799 - 2004-03-10 01:48 PM Re: Need help with multiple InGroup and drive mapping.
Detector Offline
Fresh Scripter

Registered: 2004-03-10
Posts: 6
Thanks
Top
#115800 - 2004-03-10 03:37 PM Re: Need help with multiple InGroup and drive mapping.
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Please read the KiXtart Manual with regards to the differences between IF-ELSE-ENDIF and SELECT-CASE-ENDSELECT.
_________________________
There are two types of vessels, submarines and targets.

Top
#115801 - 2004-03-10 03:51 PM Re: Need help with multiple InGroup and drive mapping.
Detector Offline
Fresh Scripter

Registered: 2004-03-10
Posts: 6
Thanks sealeopard. Can someone explain why I'm not having any luck removing an existing mapped drive via my script?

I have switched servers and am trying to remap the users mapped drive(Drive K) to the new server. The Use K: /Del or /DELETE does not remove their presently mapped drive so the Use K: "\\server\folder" does not work. It works fine as long as they don't have a K drive mapped.

Thanks.

Top
#115802 - 2004-03-10 03:53 PM Re: Need help with multiple InGroup and drive mapping.
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Try using the "/persistent" switch on the deletes.
Top
#115803 - 2004-03-10 03:54 PM Re: Need help with multiple InGroup and drive mapping.
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Persistently mapped drives need to be deleted via the /PERSISTENT switch. It's a best practice to alwasy use the /PERSISTENT switch when deleting drive mappings. See the KiXtart Manual under USE.
Code:

USE U: /DELETE /PERSISTENT

_________________________
There are two types of vessels, submarines and targets.

Top
#115804 - 2004-03-10 04:06 PM Re: Need help with multiple InGroup and drive mapping.
Detector Offline
Fresh Scripter

Registered: 2004-03-10
Posts: 6
Thanks again. you guys rock. It worked great.
Top
Page 1 of 1 1


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

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

Generated in 0.052 seconds in which 0.021 seconds were spent on a total of 12 queries. Zlib compression enabled.

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