Home drive move

  • Thread starter Thread starter john
  • Start date Start date
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
 
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:oldserver=\\newserver%
dsmod user %user% -hmdir %homedir%


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