Home drive move

john

Splendid
Aug 25, 2003
3,819
0
22,780
Archived from groups: microsoft.public.win2000.file_system (More info?)

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
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.file_system (More info?)

On Mon, 14 Mar 2005 12:39:32 -0000, "john" <john@stiell.com> wrote:

>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:eek:ldserver=\\newserver%
dsmod user %user% -hmdir %homedir%


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