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.
Melinda Burnscomputer supportAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pjamCommented:
do they have the login bat in their profile?
Melinda Burnscomputer supportAuthor Commented:
yes they do.
ConfigtermCommented:
Can this be reproduced on another PC ?   Does the user occasionally use a portable usb drive ?
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

Juan Jose PerezMIS CoordinatorCommented:
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?
Melinda Burnscomputer supportAuthor Commented:
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.
Juan Jose PerezMIS CoordinatorCommented:
does this drive has a letter assigned like E or D? that is interference with USB or DVD
JohnBusiness Consultant (Owner)Commented:
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?
Juan Jose PerezMIS CoordinatorCommented:
does this map has a letter assigned like E or D that interference with USB or DVD drives??
Melinda Burnscomputer supportAuthor Commented:
No it doesnt. I did check that.
Juan Jose PerezMIS CoordinatorCommented:
can you copy part of your script??

do you use net use Driveletter /delete?
and then net use drive letter
Melinda Burnscomputer supportAuthor Commented:
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.,\
Melinda Burnscomputer supportAuthor Commented:
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
Juan Jose PerezMIS CoordinatorCommented:
is the user part of the cadarch_ro?
Melinda Burnscomputer supportAuthor Commented:
No he is in the Cadarch_Full
Juan Jose PerezMIS CoordinatorCommented:
change the script for Cadarch_Full  just for this user.... and test
Juan Jose PerezMIS CoordinatorCommented:
because you are comparing Const G_Drive = "cn=cadarch_ro" vs  "Cadarch_Full"
Melinda Burnscomputer supportAuthor Commented:
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.
Melinda Burnscomputer supportAuthor Commented:
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.
Juan Jose PerezMIS CoordinatorCommented:
only this:

Const G_Drive = "cn=cadarch_ro"

for this

Const G_Drive = "cn=cadarch_full"

and run it
TG TranIT guyCommented:
Have you checked the \\GE-H1\ and  \\GE-H1\cadarch shares again user account.  All the permissions are there?
Melinda Burnscomputer supportAuthor Commented:
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.
David Johnson, CD, MVPRetiredCommented:
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 

Open in new window


is the user a member of group G_Drive
Melinda Burnscomputer supportAuthor Commented:
David Johnson --  yes he is.
Juan Jose PerezMIS CoordinatorCommented:
the script is looking for "cadarch_ro" not for "cadarch_full" , can you have the other users has a group that point to cadarch_ro?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Melinda Burnscomputer supportAuthor Commented:
NLD_MIS   I am not sure what you are asking
Juan Jose PerezMIS CoordinatorCommented:
can you check if the users that has access to G_drive has another group that point or are member of cadarch_ro?
Melinda Burnscomputer supportAuthor Commented:
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
Melinda Burnscomputer supportAuthor Commented:
Thank you for all the support.
Juan Jose PerezMIS CoordinatorCommented:
please click Accept Solution in the comment.

regards
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.