Link to home
Start Free TrialLog in
Avatar of mentisgroup
mentisgroup

asked on

PC Remapping

At one of my client sites there was a server (Server A) that I had to remove from the domain to repair.  I loaded the volumes on another server temporarily (Server B).  When it was taken offline, the users were not able to access their shares so I ended up going to each individual PC to remap their respective shares.  
I have repaired that server (Server A) & it is in production now.  It just needs the volumes loaded back to Server A  My question:
 
Is there a better way to do this than to go to each individual workstation & remap drives?  Maybe a group policy or login.bat file?
Avatar of fatlad
fatlad

a login script could work for this, and would be quite easy.
Hi.  The best solution is a login script file.  This way you can format a machine, login as a different user, etc., when a user logs into the domain, the login script is run and all drives mapped.  You can also do other things with the script like time sync, etc.

You can also have differnt login scripts for different users or groups.

Cheers
Mark
Avatar of mentisgroup

ASKER

OK....now the stupid question - How would I do that?
If you want an example, let me know.

Cheers
Mark
I would please.  Thanks for your assistance!!
Would look into login batch files.  Can also be done from Group Policy.  

With batch files, you can delete specific mapped drives with the following:
net use <drive letter> /d /y

Then map them to server A once again.


Example:

net use s: /d /y
net use s: \\serverAname\sharename
Here is a great page for logon scripts:

http://www.computerperformance.co.uk/Logon/logon_scripts.htm

And this site near the bottom had great info [and good info in general for Batch files]:

http://www.onesmartclick.com/programming/batch-files.html

A small example would be the script I use for myself to map data drives at the office:

logon.bat [file name]
net use g: \\domain-server\data
net use i: \\domain-server\reports
net use lpt2 \\domain-server\hp5

Whereever and whenever I login, Drives G and I are mapped to those shares on the server and maps the HPLJ 5 to LPT2 locally.  You can then see these mapping in windows.

Cheers
Mark
Avatar of Lee W, MVP
Login scripts are good - but for simple editing, assuming replacing a server is something that has to be done often enough, you might want to use a variable name for the server name - for example:

SET TheServer=SERVERB
NET USE g: \\%TheServer%\data
NET USE i: \\%TheServer%\reports
NET USE lpt2 \\%TheServer%\hp6

(I've seen and created some long login scripts and using a variable can make things easy to move by editing one line instead of 6)

Another option is to setup a distributed file system incorporating Active Directory.  If you setup both servers as part of the DFS and configure file replication, then you can map to the domain name instead of the server name (I've never setup a DFS for file sharing before - beyond install software - this might require a little more research.  Check out http://www.microsoft.com/windows2000/techinfo/howitworks/fileandprint/dfsnew.asp
Cool.  Thanks guys.  In what instances would these examples NOT work?  In Group Policy, I added the logon.bat file.  I went into EDIT to look at the syntax and everything looked ok.  I have a PC that I am testing on before I go live to the domain & want to make sure I don't spend a full day going to each & every workstation to map.  On the test PC, the drives are not added on logon.  
Where did you put the logon.bat file?  Also try it in the user profile itself to see if it works.

Cheers
Mark
Group Policy Login scrripts are probably where microsoft is going to focus things in the long term, but I'd suggest putting it in ye olde netlogon folder, C:\WINDOWS\SYSVOL\sysvol\viartcorp.local\scripts

You would then assign the script to the users in the user object properties in Active Directory.

I would then test things to see what happens by mapping a drive to \\server\netlogon and running the script manually from a dos prompt.  This way you see everything that happens and can more easily debug.

You can probably debug similarly with the GPO scripts, but you'll have to figure out where they are stored (typically in a buried location with MANY characters in length).
(Quick note - my domain name is the path above - replace viartcorp.local with whatever your domain name is)
I am loading the volumes on Tuesday, the 7th at night & the examples will not work for some odd reason.  I've created the script which is easy enough to do but will not work when applied on a test PC.  Instead of going to each workstation I am in the middle of creating a document for the end-user to follow to remap their drives - which is the last thing I wanted to do.  Are there any utilities that can be downloaded to diagnose group policy issues?  I think I am applying the policies correctly but I am not sure.  By the way - I am on a 2000 server network with XP clients.  
ASKER CERTIFIED SOLUTION
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial