Detector
(Fresh Scripter)
2004-03-10 12:03 PM
Need help with multiple InGroup and drive mapping.

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.


Richard H.Administrator
(KiX Supporter)
2004-03-10 12:24 PM
Re: Need help with multiple InGroup and drive mapping.

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



Detector
(Fresh Scripter)
2004-03-10 01:48 PM
Re: Need help with multiple InGroup and drive mapping.

Thanks

Sealeopard
(KiX Master)
2004-03-10 03:37 PM
Re: Need help with multiple InGroup and drive mapping.

Please read the KiXtart Manual with regards to the differences between IF-ELSE-ENDIF and SELECT-CASE-ENDSELECT.

Detector
(Fresh Scripter)
2004-03-10 03:51 PM
Re: Need help with multiple InGroup and drive mapping.

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.


Richard H.Administrator
(KiX Supporter)
2004-03-10 03:53 PM
Re: Need help with multiple InGroup and drive mapping.

Try using the "/persistent" switch on the deletes.

Sealeopard
(KiX Master)
2004-03-10 03:54 PM
Re: Need help with multiple InGroup and drive mapping.

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



Detector
(Fresh Scripter)
2004-03-10 04:06 PM
Re: Need help with multiple InGroup and drive mapping.

Thanks again. you guys rock. It worked great.