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!

Need drive mapping help.

Status
Not open for further replies.

wantagofast

Technical User
Jun 19, 2002
47
0
0
US
I know this issue has been beat to death but I seem to be having a drive mapping issue. Can someone tell me why the batch file I have does not map the drives when a user boots up the workstation but when I have the user log off and log back on the workstation the batch file maps the drives.

Windows 2000 server
Windows XP Pro

I've tried using scripts and batch files. Either one does not map upon boot up.

I have the batch file in a the Netlogon folder on the DC. Here is the batch file.

net use f: \\%computer%\folder1\
net use m: \\%computer%\folder2\
net use i: \\%computer%\folder3\
net use u: \\%computer%\users\%USERNAME%\

Thanks in advance.

Matt
 
A quick guess... Add USER credentials information. Without a user logged on, how can the drive get mapped? Who is mapping the drive. I would try to add security to the mapping.


NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[username@dotted domain name]
[/SMARTCARD]
[/SAVECRED]
[[/DELETE] | [/PERSISTENT:{YES | NO}]]

NET USE {devicename | *} [password | *] /HOME

NET USE [/PERSISTENT:{YES | NO}]

(Just guessing though...might be bad to put user name and passwords in batch files for security reasons.)


Joseph L. Poandl
MCSE 2003

If your company is in need of experts to examine technical problems/solutions, please check out (Sales@njcomputernetworks.com)
 
Thanks Joseph for your response but all users get the same drives mapped when logging onto the domain. The issue is why does the drives map when a user logs off their machine but if the user reboots or shuts down and start their machine, the drives don't map.

Thanks.

Matt
 
Are you using a group policy for this? (Startup/shutdown scripts) or local Policy?



Joseph L. Poandl
MCSE 2003

If your company is in need of experts to examine technical problems/solutions, please check out (Sales@njcomputernetworks.com)
 
I do have the file in the startup group policy.

Thanks.

Matt
 
Could be because the reboot is cold, and no user has been logged on, hence there is no load of the batch file on the initial boot, but after log on, off, then on again, the batch file kicks in. I presume the batch file is part of the user log on, not in the system startup configuration, and no drives are mapped until a user logs on? Is this local or domain policy that does the script?

HTH

David
 
David,

I have the script in the domain policy so when the user logs on, the script should be applied to the user. That is how it's suppose to work. Isn't it?

Thanks.

Matt
 
Sounds like you script doesn't run at all at startup.
Maybe you could set you script to run visible so you would know if the script runs at startup.

Normally your script should run at logon and not at startup assuming groups and department get different drives.

A workstation could be running but not log on.
I tent to use GPO on startup to lock the stations (ex.: I don't want anybody to run specific programs or features)

One more thing... when the workstation is booting up, is it logging in a specific account automatically? or do they have a login window waiting for credentials?
 
Tecknic,

Users have to log into the domain with credentials. How do I view the script at log on to see if it is actually running?

Thanks.

Matt
 
Matt

go into the gpedit.msc
administrative template / system /script
and enable the run visible.

otherwise
you can add ECHO function on your script too.

Tecknic
 
OK. I finally got the errors out of the batch file. Now the problem is I can get the script to run when someone logs onto the network. I added the script to User Config - Windows Settings - Scripts - Logon. Script still will not run.

Any ideas?

Thanks.

Matt
 
Can you be more specific please? Is it running on some machine or not? Do you see it run? You can add "pause" in the script so you will see it running. sometime it runs to fast to see or to read any messages. once debug you can remove the "pause".

You add the script in the GPO on the local machine or on the server?
 
Sorry if I am not clear. The script is not running on any of the domain workstations. The script runs correctly when executed manually from windows explorer. I found a flaw in the script eariler by using the "pause" statement. I added the script on the server through AD GPO.

Thanks.

Matt
 
I'm no expert in GPO but from what I understand you need a special module attach to the GPO. When the users login you the system call that specific module and and then apply the script.

I will check for the procedure by next for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top