Re: Login script and drive mappings

Tech-Archive recommends: Fix windows errors by optimizing your registry




"hrd2fnd" <hrd2fnd.3hpgjd@xxxxxxxxxxxxx> wrote in message
news:hrd2fnd.3hpgjd@xxxxxxxxxxxxxxxx

Having no experiance with scripting I thought I would ask for some
help.

I have this login script that maps 2 groups to the same drive letter
depending on which group they are in. The problem is the users are in
both groups and none of the drive mappings will map.

I'm assuming that it is because of being in both groups that want the
same drive letter. Can anyone give me some advice?

Here is a pasting of the script.

Thank you in advance

Hrd

Case "DEPT-xxxx_xxxx"
WSHNetwork.RemoveNetworkDrive "W:"
wscript.sleep 300
WSHNetwork.MapNetworkDrive "W:", "\\server1\xxx\xxx",True
Case "DEPT-yyyy_GRP"
WSHNetwork.RemoveNetworkDrive "W:"
wscript.sleep 300
WSHNetwork.MapNetworkDrive "W:", "\\server1\xxx\yyyy",True



You have to either use different drive letters, or code so that one group
has preference over the other. However, assuming you have pasted code from a
"Select Case" construction, that is what should happen. Only the first
matching "Case" clause executes. If you run the "Select Case" statement
repeatedly for each group the user is a member, that is a problem. You need
to exit the loop after the first group match is found, perhaps with an "Exit
For" statement.

The most likely problem is that the group name does not match exactly with
any of your Case clauses because of case (upper and lower case characters).
I would suggest using the LCase function with the group name, then using
only lower case group names, like "dept-xxxx_xxxx".

Otherwise, we may need to see more of your script (especially how you get
group memberships). Also, there is no need for the Sleep statements.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


.



Relevant Pages

  • Re: Updating the HomeFolder Attribute
    ... The last time I wrote a script like this I only put "H" in the drive letter field because the colon ":" in the UI isn't part of the drop down in the field, ... When a user logs in using their newID, the home folder doesn't map. ... If I check the information stored in the users profile it contains the ...
    (microsoft.public.scripting.vbscript)
  • RE: Windows Log
    ... a savvy user would be able to create problems with a script based method of recording user logons and logoffs. ... ' Choose a drive letter and enter your share name below. ... >>> education and the case study affords you unmatched consulting experience. ... >>> Computer Emergency Response Teams, ...
    (Security-Basics)
  • Login script and drive mappings
    ... I have this login script that maps 2 groups to the same drive letter ... Here is a pasting of the script. ...
    (microsoft.public.windows.server.general)
  • Re: Change the Drive Letter of a Volume
    ... We have prepared Windows XP SP2 computer ... How could I change CD-ROM drive letter from command prompt or script? ...
    (microsoft.public.windows.server.scripting)
  • Re: NTbackup Scheduled tasks do not run unless console is logged in
    ... script is about to run - then disconnect the drive at the end of the ... "The media was created by a differnt application - do you want to ... The next best solution is to use a different drive letter, ... Using mapped drive letters in a scheduled task is never a ...
    (microsoft.public.win2000.general)