Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a login script 5

Status
Not open for further replies.

RockChalk

Technical User
Sep 18, 2003
136
0
0
US
I tried reading thru all the post about login scripts and I don't understand. Can someone tell me how to take a simple login script that maps our users to a userdata folder?

Here is the script.
net use H: \\servername\userdata

I saw that you ready shouldn't use your main domain controller to handle scripts. Is that right?

RC
 
Check to see if you have set in your group policy to wait for the network to initialize. The problem you are seeing is the result of a default setting in Windows XP that is designed to let the user log on faster but creates problems in cases like this.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
I made the change within the OU's, but it still occurs. What's funy is that all the other drives work fine except for the home drive (ex., f, t, r, etc.,). Just on XP, on W2K everything is great.
Any ideas?

Thanks,
 
I did a little experiment and added a messagebox right before, and then later on, right after the line of code that does the mapping to show what the username variable is. It is right when it displays, but then doesn't map. on a w2k machine though, it's fine, just not on XP.

Thanks,
 
Do the XP machines already have a drive letter mapped that perhaps needs to be removed first?

Did you either reboot or force a policy update ont he XP computers? Give this a try fro a command prompt:

GPUPDATE /FORCE

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Unfortunatly, that did not work either. Below is the begining of the script that we are using. Again, on W2K machines, no problem. On windows xp machines, some work and some don't. I just found out that some machines don't get the T drive all the time either (see below for T drive). The t drive share is allows authenticated users access, whereas the H is just the user (and domain admins).

On ERROR RESUME Next
Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
DomainString = "domain"
UserString = WSHNetwork.UserName

Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)

WSHNetwork.RemoveNetworkDrive "H:",True,True

wscript.sleep 300

'Maps drives needed by all
WSHNetwork.MapNetworkDrive "H:", "\\nyhomes01\" & userstring & "$",True
WSHNetwork.MapNetworkDrive "T:", "\\nyshared\shared$"

The domain name is changed for security reasons. Any ideas?


Thanks,
 
Your code looks good to me. You say that some of the XP machines it works on but not all? Have you compared DNS settings on these machines? Let's make sure they are all able to resolve the server name to IP. I'd also see if you have an XP machien that looks like it gets the mapping OK, try logging on to that machine with the ID of a user havign the problem to determine if the problem is machine or folder share related.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
You could also maybe try deleting the local profile of the user you are trying to login with and start from scratch.


Dustin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top