Drive Mapping Logon Script

J

Jim

I'm a computer tech for a non-profit organization. Our IS Staff is comprised
of 5 people that aren't even close to being experts. We just moved from a
workgroup setup to AD with multiple sites (one domain controller at each
site, one GC). We had help doing the initial setup but we've been running
into little problem after little problem since the switch (mostly permission
based). Making this switch has been no joke!

I'm trying to figure out how to make a logon script work that will map a
couple of drives automatically to our file server for our users. I read that
making a batch script like this will work (and it does when I manually run
it on a workstation):

net use z: /d>nul 2>&1
net use z: \\server\share /p:y

I don't know what the /d>nul 2>&1 does and I'm not completely clear about
the /persistance switch. I know that it works though (when ran manually).

I think my problem is setting it up in AD Users&Computers. I chose
properties of a user and go to the Profile tab. In the "Logon Script" field
I put the full path to the batch file. When I log onto the domain with that
account the drive does not get mapped. My goal is to map two drives to
different servers.

I'm really new in this area and I'd really appreciate some help.

Also, if there is a way to automatically set up a network printer (basic
\\server\printer type) in a logon batch file, that would rock!

Thanks!
 
J

Jerold Schulman

I'm a computer tech for a non-profit organization. Our IS Staff is comprised
of 5 people that aren't even close to being experts. We just moved from a
workgroup setup to AD with multiple sites (one domain controller at each
site, one GC). We had help doing the initial setup but we've been running
into little problem after little problem since the switch (mostly permission
based). Making this switch has been no joke!

I'm trying to figure out how to make a logon script work that will map a
couple of drives automatically to our file server for our users. I read that
making a batch script like this will work (and it does when I manually run
it on a workstation):

net use z: /d>nul 2>&1
net use z: \\server\share /p:y

I don't know what the /d>nul 2>&1 does and I'm not completely clear about
the /persistance switch. I know that it works though (when ran manually).

I think my problem is setting it up in AD Users&Computers. I chose
properties of a user and go to the Profile tab. In the "Logon Script" field
I put the full path to the batch file. When I log onto the domain with that
account the drive does not get mapped. My goal is to map two drives to
different servers.

I'm really new in this area and I'd really appreciate some help.

Also, if there is a way to automatically set up a network printer (basic
\\server\printer type) in a logon batch file, that would rock!

Thanks!
You place the script in the NETLOGON share, which is
C:\WINDOWS\sysvol\sysvol\<DomainName>\SCRIPTS

You configure the script path relative to this, so it is generally just
logon.bat

net use z: /d>nul 2>&1
deletes Z: and pipes any console responses and errors to nowhere

net use z: \\server\share /p:y

I don't see any need to make the share persistent. Use
net use z: \\server\share /p:n

See tip 2014 in the 'Tips & Tricks' at http://www.jsiinc.com

Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
D

David Trimboli

I think my problem is setting it up in AD Users&Computers. I chose
properties of a user and go to the Profile tab. In the "Logon Script" field
I put the full path to the batch file. When I log onto the domain with that
account the drive does not get mapped. My goal is to map two drives to
different servers.

In addition to what Jerold posted, I'd ask: are you sure the login script is
running? Try putting a PAUSE command at the end of the script; that'll keep
the window from closing as soon as the script is done. Then you can look at
the output of the script (unless you >NUL'd them out). Take out the >NUL's
for a bit to see if there are any errors.

Also, make sure you have access to the network shares you're trying to map.
You did mention security permission problems. You might be getting an
"access denied" type of message and not know it, because you're not watching
the script.

David
Stardate 3845.9
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top