Home drive move

J

john

Please help

I need to move 600 users home drives to a new server, I have managed to copy
over the share names and permissions, but in their AD setting it points
their H drive to \\server\share\username

Is there a way of automatically changing the old server name to the new one
without going through them individually

Thanks
 
J

Jerold Schulman

Please help

I need to move 600 users home drives to a new server, I have managed to copy
over the share names and permissions, but in their AD setting it points
their H drive to \\server\share\username

Is there a way of automatically changing the old server name to the new one
without going through them individually

Thanks
From any Windows XP or WIndows Server 2003 in the domain, run the following script, replacing oldserver, share, and newserver with the proper values:

@echo off
setlocal
set qry=dsquery * domainroot -filter "(&(objectCategory=Person)(objectClass=User))" -attr distinguishedName HomeDirectory -limit 0
for /f "Tokens=1* Delims=\" %%u in ('%qry%^|FIND /I "\\oldserver\share\"') do (
call :update "%%u" "%%v"
)
endlocal
goto :EOF
:update
set user=%1
set user=%user: =%
set user=%user:" ="%
set user=%user: "="%
set homedir=%2
set homedir=%homedir: =%
set homedir=%homedir: "="%
set homedir=%homedir:blush:ldserver=\\newserver%
dsmod user %user% -hmdir %homedir%


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

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