Re: Login script and drive mappings




"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: Get custom database properties from an Access database
    ... will write the script to look for an available letter, ... If you're concerned about another drive letter causing ... will have no effect on the user's interaction with the database. ... As for the server, yes, that would definitely be the way to go. ...
    (microsoft.public.scripting.vbscript)
  • Re: Printer Mapping Problem/Preferances
    ... The script pretty much tells you everything you need to know. ... (not a mapping!) ... You have set up drive maps, which also implies some familiarity with the GPMC and the preferences sections more specifically. ... XP Pro computers so that when they open up My Network they see the mappings (sans the drive letter, ...
    (microsoft.public.windows.server.sbs)
  • 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)