i need a Logon Script that maps drives, per Group.
I have been working on a logon script for the last week, and it is getting very frustrating.
I have tried a few different bat, and vbs files. None are working at all.
I need a script, that will map certain drives, depending on the users group.
Here is a vbs script I found, but it is not working, its not calling up the other scripts.
BTW, how can I display the UserObj variable?
I cant even error check it, to see if that variable is getting set to the group, cuz I cant figure out a way to display its value.
Also, I see it has WinNT as part of the directory, but I am running Windows Server 2003. Should I change it to something else? If so, what?
The below script is supposed to call up other scripts, that are named the same as the group.
' Let's declare some variables that we'll need....
Dim Domain, UserObj, Group, GroupObj, UserName, nUser,wsh, sArray
Dim test
'Now give them their initial values.....
Set wsh = WScript.CreateObject("Wscript.Shell")
Set nUser = WScript.CreateObject("Wscript.Network")
Domain = nUser.UserDomain
UserName = nUser.UserName
'Now get the current user name and domain from ADS....
Set UserObj = GetObject("WinNT://" & Domain & "/" & UserName)
'Go through each group, executing the .vbs file for each one......
On Error Resume Next
For Each GroupObj in UserObj.Groups
'The next two lines strip the spaces from the Group in question
' because the script name cannot have spaces in it
sArray= Split(GroupObj.name)
sJoin = Join(sArray,"")
'This calls the script named from the group membership....
wsh.Run ("\\KITE\munnr$\Login\" & sJoin &".vbs"), bWaitOnReturn
Next
Wscript.quit