Melinda Burns
asked on
login script does not map all drives.
We currently have a login script that maps all the drives for our users. one users loses a drive when he reboots his system. I have checked his permission and security settings and he has full access to the drive in question. It works for all the other users.
do they have the login bat in their profile?
ASKER
yes they do.
Can this be reproduced on another PC ? Does the user occasionally use a portable usb drive ?
Does this PC has good login to domain?
Do you need to input user name and password to reconnect the maps?
do you have Drive Letters assigned with the same letter?
Do you need to input user name and password to reconnect the maps?
do you have Drive Letters assigned with the same letter?
ASKER
When he logs into another computer, the same thing happens. It will map all the other drives except for one particular drive. he ends up having to manually map it.
does this drive has a letter assigned like E or D? that is interference with USB or DVD
Can you open a regular (not admin) command prompt and do the following:
1. NET USE X: /Delete for all drives in the script.
2. NET USE <enter> and what is left? Anything?
3. Run the script in the Command Prompt. What error occurs?
1. NET USE X: /Delete for all drives in the script.
2. NET USE <enter> and what is left? Anything?
3. Run the script in the Command Prompt. What error occurs?
does this map has a letter assigned like E or D that interference with USB or DVD drives??
ASKER
No it doesnt. I did check that.
can you copy part of your script??
do you use net use Driveletter /delete?
and then net use drive letter
do you use net use Driveletter /delete?
and then net use drive letter
ASKER
John,,,I deleted all the mapped drives using the NET USE command and then ran the script again. and it still did not map the G: Drive All the other drives were mapped.,\
ASKER
Const G_Drive = "cn=cadarch_ro"
Const J_Drive="cn=commercial_ro"
Const M_Drive="cn=drafting_full"
Const X_Drive="cn=mep full"
Const R_Drive="cn=revit_full"
Set objNet = CreateObject("WScript.Netw ork")
Set oShell = CreateObject("Shell.Applic ation")
Set wshell = CreateObject("WScript.Shel l")
Set objUser = CreateObject("ADSystemInfo ")
Set CurrentUser = GetObject("LDAP://" & objUser.UserName)
strGroup = LCase(Join(CurrentUser.Mem berOf))
On Error Resume Next
wshShell.Run "%COMSPEC% /c net time ", 0, True
set wshell = Nothing
objNet.RemoveNetworkDrive "g:", True, True
objNet.RemoveNetworkDrive "i:", True, True
objNet.RemoveNetworkDrive "j:", True, True
objNet.RemoveNetworkDrive "k:", True, True
objNet.RemoveNetworkDrive "l:", True, True
objNet.RemoveNetworkDrive "m:", True, True
objNet.RemoveNetworkDrive "n:", True, True
objNet.RemoveNetworkDrive "o:", True, True
objNet.RemoveNetworkDrive "r:", True, True
objNet.RemoveNetworkDrive "t:", True, True
objNet.RemoveNetworkDrive "u:", True, True
objNet.RemoveNetworkDrive "w:", True, True
objNet.RemoveNetworkDrive "x:", True, True
objNet.RemoveNetworkDrive "z:", True, True
objNet.MapNetworkDrive "h:", "\\GE-H1\Home\" & objNet.UserName
Drive = "H:\"
oShell.NameSpace(Drive).Se lf.Name = "Home"
objNet.MapNetworkDrive "i:", "\\GE-H1\tpl"
Drive = "i:\"
oShell.NameSpace(Drive).Se lf.Name = "TPL"
objNet.MapNetworkDrive "k:", "\\GE-H1\data"
Drive = "k:\"
oShell.NameSpace(Drive).Se lf.Name = "Data"
objNet.MapNetworkDrive "l:", "\\GE-H1\complete\" & objnet.UserName
Drive = "l:\"
oShell.NameSpace(Drive).Se lf.Name = "Complete"
objNet.MapNetworkDrive "n:", "\\GE-H1\name\" & objNet.UserName
Drive = "n:\"
oShell.NameSpace(Drive).Se lf.Name = "Name"
objNet.MapNetworkDrive "o:", "\\GE-H1\common"
Drive = "o:\"
oShell.NameSpace(Drive).Se lf.Name = "Common"
objNet.MapNetworkDrive "t:", "\\GE-H1\img_data"
Drive = "t:\"
oShell.NameSpace(Drive).Se lf.Name = "Img Data"
objNet.MapNetworkDrive "u:", "\\GE-H1\jismn"
Drive = "u:\"
oShell.NameSpace(Drive).Se lf.Name = "JISMN"
objNet.MapNetworkDrive "z:", "\\GE-H1\archive"
Drive = "z:\"
oShell.NameSpace(Drive).Se lf.Name = "JIS Archive"
If InStr(strGroup, lcase(R_Drive)) Then
objNet.MapNetworkDrive "r:", "\\GE-H1\revit"
Drive = "r:\"
oShell.NameSpace(Drive).Se lf.Name = "Revit"
End If
If InStr(strGroup, lcase(G_Drive)) Then
objNet.MapNetworkDrive "g:", "\\GE-H1\cadarch"
Drive = "g:\"
oShell.NameSpace(Drive).Se lf.Name = "Cadarch"
End If
If InStr(strGroup, lcase(J_Drive)) Then
objNet.MapNetworkDrive "j:", "\\GE-H1\commercial"
Drive = "j:\"
oShell.NameSpace(Drive).Se lf.Name = "Commercial"
End If
If InStr(strGroup, lcase(M_Drive)) Then
objNet.MapNetworkDrive "m:", "\\GE-H1\drafting\libio"
Drive = "m:\"
oShell.NameSpace(Drive).Se lf.Name = "Libio"
End If
If InStr(strGroup, lcase(X_Drive)) Then
objNet.MapNetworkDrive "x:", "\\GE-H1\MEP"
Drive = "x:\"
oShell.NameSpace(Drive).Se lf.Name = "MEP"
End If
Const J_Drive="cn=commercial_ro"
Const M_Drive="cn=drafting_full"
Const X_Drive="cn=mep full"
Const R_Drive="cn=revit_full"
Set objNet = CreateObject("WScript.Netw
Set oShell = CreateObject("Shell.Applic
Set wshell = CreateObject("WScript.Shel
Set objUser = CreateObject("ADSystemInfo
Set CurrentUser = GetObject("LDAP://" & objUser.UserName)
strGroup = LCase(Join(CurrentUser.Mem
On Error Resume Next
wshShell.Run "%COMSPEC% /c net time ", 0, True
set wshell = Nothing
objNet.RemoveNetworkDrive "g:", True, True
objNet.RemoveNetworkDrive "i:", True, True
objNet.RemoveNetworkDrive "j:", True, True
objNet.RemoveNetworkDrive "k:", True, True
objNet.RemoveNetworkDrive "l:", True, True
objNet.RemoveNetworkDrive "m:", True, True
objNet.RemoveNetworkDrive "n:", True, True
objNet.RemoveNetworkDrive "o:", True, True
objNet.RemoveNetworkDrive "r:", True, True
objNet.RemoveNetworkDrive "t:", True, True
objNet.RemoveNetworkDrive "u:", True, True
objNet.RemoveNetworkDrive "w:", True, True
objNet.RemoveNetworkDrive "x:", True, True
objNet.RemoveNetworkDrive "z:", True, True
objNet.MapNetworkDrive "h:", "\\GE-H1\Home\" & objNet.UserName
Drive = "H:\"
oShell.NameSpace(Drive).Se
objNet.MapNetworkDrive "i:", "\\GE-H1\tpl"
Drive = "i:\"
oShell.NameSpace(Drive).Se
objNet.MapNetworkDrive "k:", "\\GE-H1\data"
Drive = "k:\"
oShell.NameSpace(Drive).Se
objNet.MapNetworkDrive "l:", "\\GE-H1\complete\" & objnet.UserName
Drive = "l:\"
oShell.NameSpace(Drive).Se
objNet.MapNetworkDrive "n:", "\\GE-H1\name\" & objNet.UserName
Drive = "n:\"
oShell.NameSpace(Drive).Se
objNet.MapNetworkDrive "o:", "\\GE-H1\common"
Drive = "o:\"
oShell.NameSpace(Drive).Se
objNet.MapNetworkDrive "t:", "\\GE-H1\img_data"
Drive = "t:\"
oShell.NameSpace(Drive).Se
objNet.MapNetworkDrive "u:", "\\GE-H1\jismn"
Drive = "u:\"
oShell.NameSpace(Drive).Se
objNet.MapNetworkDrive "z:", "\\GE-H1\archive"
Drive = "z:\"
oShell.NameSpace(Drive).Se
If InStr(strGroup, lcase(R_Drive)) Then
objNet.MapNetworkDrive "r:", "\\GE-H1\revit"
Drive = "r:\"
oShell.NameSpace(Drive).Se
End If
If InStr(strGroup, lcase(G_Drive)) Then
objNet.MapNetworkDrive "g:", "\\GE-H1\cadarch"
Drive = "g:\"
oShell.NameSpace(Drive).Se
End If
If InStr(strGroup, lcase(J_Drive)) Then
objNet.MapNetworkDrive "j:", "\\GE-H1\commercial"
Drive = "j:\"
oShell.NameSpace(Drive).Se
End If
If InStr(strGroup, lcase(M_Drive)) Then
objNet.MapNetworkDrive "m:", "\\GE-H1\drafting\libio"
Drive = "m:\"
oShell.NameSpace(Drive).Se
End If
If InStr(strGroup, lcase(X_Drive)) Then
objNet.MapNetworkDrive "x:", "\\GE-H1\MEP"
Drive = "x:\"
oShell.NameSpace(Drive).Se
End If
is the user part of the cadarch_ro?
ASKER
No he is in the Cadarch_Full
change the script for Cadarch_Full just for this user.... and test
because you are comparing Const G_Drive = "cn=cadarch_ro" vs "Cadarch_Full"
ASKER
I did make a copy of the script and placed it on his desktop. I did not write the script so i am not sure what part of the script to change.
ASKER
I can run the script and watch it delete the mapped drives per the script and watch it remap all the other drives except the G:Drive.
only this:
Const G_Drive = "cn=cadarch_ro"
for this
Const G_Drive = "cn=cadarch_full"
and run it
Const G_Drive = "cn=cadarch_ro"
for this
Const G_Drive = "cn=cadarch_full"
and run it
Have you checked the \\GE-H1\ and \\GE-H1\cadarch shares again user account. All the permissions are there?
ASKER
Ok I changed the first line from Const G_Drive = "cn=cadarch_ro" to Const G_Drive = "cn=cadarch_full"
and it worked. So why does it work on other users in the same group and not his.
and it worked. So why does it work on other users in the same group and not his.
Const G_Drive = "cn=cadarch_ro"
Const J_Drive="cn=commercial_ro"
Const M_Drive="cn=drafting_full"
Const X_Drive="cn=mep full"
Const R_Drive="cn=revit_full"
Set objNet = CreateObject("WScript.Network")
Set oShell = CreateObject("Shell.Application")
Set wshell = CreateObject("WScript.Shell")
Set objUser = CreateObject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & objUser.UserName)
strGroup = LCase(Join(CurrentUser.MemberOf))
On Error Resume Next
wshShell.Run "%COMSPEC% /c net time ", 0, True
set wshell = Nothing
objNet.RemoveNetworkDrive "g:", True, True
objNet.RemoveNetworkDrive "i:", True, True
objNet.RemoveNetworkDrive "j:", True, True
objNet.RemoveNetworkDrive "k:", True, True
objNet.RemoveNetworkDrive "l:", True, True
objNet.RemoveNetworkDrive "m:", True, True
objNet.RemoveNetworkDrive "n:", True, True
objNet.RemoveNetworkDrive "o:", True, True
objNet.RemoveNetworkDrive "r:", True, True
objNet.RemoveNetworkDrive "t:", True, True
objNet.RemoveNetworkDrive "u:", True, True
objNet.RemoveNetworkDrive "w:", True, True
objNet.RemoveNetworkDrive "x:", True, True
objNet.RemoveNetworkDrive "z:", True, True
objNet.MapNetworkDrive "h:", "\\GE-H1\Home\" & objNet.UserName
Drive = "H:\"
oShell.NameSpace(Drive).Self.Name = "Home"
objNet.MapNetworkDrive "i:", "\\GE-H1\tpl"
Drive = "i:\"
oShell.NameSpace(Drive).Self.Name = "TPL"
objNet.MapNetworkDrive "k:", "\\GE-H1\data"
Drive = "k:\"
oShell.NameSpace(Drive).Self.Name = "Data"
objNet.MapNetworkDrive "l:", "\\GE-H1\complete\" & objnet.UserName
Drive = "l:\"
oShell.NameSpace(Drive).Self.Name = "Complete"
objNet.MapNetworkDrive "n:", "\\GE-H1\name\" & objNet.UserName
Drive = "n:\"
oShell.NameSpace(Drive).Self.Name = "Name"
objNet.MapNetworkDrive "o:", "\\GE-H1\common"
Drive = "o:\"
oShell.NameSpace(Drive).Self.Name = "Common"
objNet.MapNetworkDrive "t:", "\\GE-H1\img_data"
Drive = "t:\"
oShell.NameSpace(Drive).Self.Name = "Img Data"
objNet.MapNetworkDrive "u:", "\\GE-H1\jismn"
Drive = "u:\"
oShell.NameSpace(Drive).Self.Name = "JISMN"
objNet.MapNetworkDrive "z:", "\\GE-H1\archive"
Drive = "z:\"
oShell.NameSpace(Drive).Self.Name = "JIS Archive"
If InStr(strGroup, lcase(R_Drive)) Then
objNet.MapNetworkDrive "r:", "\\GE-H1\revit"
Drive = "r:\"
oShell.NameSpace(Drive).Self.Name = "Revit"
End If
If InStr(strGroup, lcase(G_Drive)) Then
objNet.MapNetworkDrive "g:", "\\GE-H1\cadarch"
Drive = "g:\"
oShell.NameSpace(Drive).Self.Name = "Cadarch"
End If
If InStr(strGroup, lcase(J_Drive)) Then
objNet.MapNetworkDrive "j:", "\\GE-H1\commercial"
Drive = "j:\"
oShell.NameSpace(Drive).Self.Name = "Commercial"
End If
If InStr(strGroup, lcase(M_Drive)) Then
objNet.MapNetworkDrive "m:", "\\GE-H1\drafting\libio"
Drive = "m:\"
oShell.NameSpace(Drive).Self.Name = "Libio"
End If
If InStr(strGroup, lcase(X_Drive)) Then
objNet.MapNetworkDrive "x:", "\\GE-H1\MEP"
Drive = "x:\"
oShell.NameSpace(Drive).Self.Name = "MEP"
End If
is the user a member of group G_Drive
ASKER
David Johnson -- yes he is.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
NLD_MIS I am not sure what you are asking
can you check if the users that has access to G_drive has another group that point or are member of cadarch_ro?
ASKER
Ok. That was it. They were all in the Cadarch_RO group and he wasn't. Once i added him and rebooted, his drive mapped. Thank you all so much
ASKER
Thank you for all the support.
please click Accept Solution in the comment.
regards
regards