why somtimes the login scripts don't work?

Some times, for some users, the maped network drives that are configured on the login script don't work. Can anyone make any guesses on why is this happening?

Could the high CPU utllization on the server that the scripts are stored affect the proper functioning of the scripts?


Who is Participating?
Leandro IaconoSenior Premier Field EngineerCommented:
I suppose that you then added the proper network drives ...

as you know the net use command is used for these type of things. Maybe all you had to do was make sure the drive letter wasn't in use.

I am not aware of there being a time limit or other type of restriction twords net drives. I honestly can't say why this would specificly happen.

Maybe I am mis interpreting your question ... could you be a bit more specific twords what you would like to know. I meando you want to know why deleting the mapped drives and then re creating them worked, or why deleting drives maked the scripts work ...

i really don't know the specific outcome, and so I don't really know how to answer your question ...
Nirmal SharmaSolution ArchitectCommented:
I am confused here. Sometimes means when it does not work? Present a situation when it doesn't work. I mean to say produce the sequence of process.

1. Clients log on to the server.
2. User logs on to the computer.
3. Login script doesn't work.
4. User log off and then login script works.

Let me know.

GreigCityAcademyAuthor Commented:
We use a logon script to delete any previously mapped networked drives and then map the required drives.  For quite a few users (with no particular pattern and on a variety of PCs) these drives fail to be mapped when they logon to the client PC.  The user has to logon and off several times before the drives will map.

The DC which authenticates the logons and where the logon scripts are stored currently has a high utilisation of if CPU (can be upto %100 when logons are occurring).  The folders to which the network mappings are being created are on a different server.  We are wondering whether a high load on the processor could cause problems with the running of the scripts (maybe in terms of timing out...)

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Nirmal SharmaSolution ArchitectCommented:
>>>We use a logon script to delete any previously mapped networked drives and then map the required drives.  For quite a few users (with no particular pattern and on a variety of PCs) these drives fail to be mapped when they logon to the client PC.  The user has to logon and off several times before the drives will map.

That means drive has to be deleted before it is re-mapped. Run the command locally on user machine when drives doesn't map or in your words login script doesn't work. You need to the source of problem. You will come to know whether the problem is in connecting to the server who holds the shares or problem with the login script itself (if drive is not deleted you can't remap).
Do you have more than 1 domain controller?  Perhaps your script isn't replicated to an alternate DC that the user is authenticating on.
Leandro IaconoSenior Premier Field EngineerCommented:
As I disscused here (you may want to read it all to understand where I'm going) you'll understand that user logon scripts are by defualt asyncronous which means that they do not need to complete or finish in order for the user to logon to the computer and use it.

So you could either have to wait a couple of minutes for the drives to be mapped or they could timeout and nothing happens.

By defualt that what happens. You can change this behaviour through Group Policys ... I cannot remember the exact key at the moment.

However, as you will read, the problem eventually turned out being something else so this could be many things.

Did you check out the event log? which is what eventually finished sorting out the other users problems?



BTW: I'll try to get you the exact GPO key to change to modify the script behaviour. I think I mentioned a link to Microsoft KB on how to change it in the other post.
GreigCityAcademyAuthor Commented:
Hadn't thought of checking script replication however have now and they are replicating accross all our DCs.
GreigCityAcademyAuthor Commented:
UICE, thanks for the link, had a quick skim through and it looks promising, will have to wade through it on Monday.

It could be a number of things on our site and looking at some of the info on how the scripts work and thinking about it we may still have a timing issue on our site, we did a crude fix using the net time command however that may not have been completly effective as it does rely on drive mapping to work.
In your logon script, are you checking for success/failure on the calls to RemoveNetworkDrive and MapNetworkDrive?  Are you passing the second parameter of TRUE to RemoveNetworkDrive (to delete the "remembered" setting from the registry)?  Can you add some logic to retry failed operations a few times?

I've built logon scripts to remove all drivemappings then map only the desired set a few times, but I've never witnessed the "sometimes it works and sometimes it doesn't" problem you described.

Leandro IaconoSenior Premier Field EngineerCommented:
Glad the info could help out.

Please be sure to post up on what you do on monday... I am terribly interested in these type of problems ...

What JesterToo suggested could also help out ...

Maybe make the user scripts Echo errors out if they didn't complete for some reason as he suggested....

Anyways, good luck mate!
GreigCityAcademyAuthor Commented:
Sorry for the long delay in replying things have been hectic and this dropped to the bottom of the list.

The following has worked, why I don't know...  we remarked out the line that we where using to delete all mapped drives as shown below;

rem net use * /d /y

We then explicitly deleted the drives one by on using commands as shown below;

net use s: /d
net use etc...

This has solved our problem, if anyone can tell me why I will be interested to hear...

Thanks for your efforts.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.