Using DSQUERY and DSMOD, I have scripted ChgSrv.bat to modify all users homeDrive, homeDirectory, and/or profilePath attributes.

The syntax for using ChgSrv.bat is:

ChgSrv \[H:OldSrv1:NewSrv1 D:OldDrv:NewDrv\] \[P:OldSrv2:NewSrv2\]

Where:

<b>H:OldSrv1:NewSrv1</b> will modify the <b>homeDirectory</b>, changing the existing <b>OldSrv1</b> to <b>NewSrv1</b>.
                  Both components may be null. When <b>NOT</b> nul, they must start with \\. If a <b>$sam$</b> string is detected,
                  it will be replaced with the <b>sAMAccountName</b>.

<b>D:OldDrv:NewDrv</b>   will modify the <b>homeDrive</b>, changing the existing <b>OldDrv</b> letter to <b>NewDrv</b>.
                  Both components may be null. When <b>NOT</b> null, they must be a single character.<p>

<b>P:OldSrv2:NewSrv2</b> will modify the <b>profilePath</b>, changing the existing <b>OldSrv2</b> to <b>NewSrv2</b>.
                  Both components may be null. When <b>NOT</b> null, they must start with \\. If a <b>$sam$</b> string is detected,
                  it will be replaced with the <b>sAMAccountName</b>.</p>

Sample Valid Usage:

chgSrv H::\\ServerName\Home\$sam$ D::H P::\\ServerName\Profiles\$sam$ will change all users whose homeDrive, homeDirectory attributes are null, and all users whose profilePath attribute is null.

chgSrv H:\\Server1:\\Server2 D:H:H will change all users whose homeDrive is H and homeDirectory is on Server1 to a homeDirectory on Server2, leaving their homeDrive as H.

chgSrv P:\\ServerName\Profiles\$sam$: will change all users whose profilePath attribute is \\ServerName\Profiles\UserName to a local profile, leaving their homeDrive and homeDirectory where they are.

ChgSrv.bat contains:

@echo off
setlocal
if \{%1\}<h1><a name="_goto_syntax_set_sam_set_Holdsrv_#_set_Hnewsrv_#_set_Poldsrv_#_set_Pnewsrv_#_set_Holddrv_#_set_Hnewdrv_#_set_param_1_for_f_Tokens_1_3_Delims_a_in_echo_1_do_set_type_a_set_old_b_set_new_c_if_param_1_2_EQU_set_new_old_amp_set_old_if_i_type_NEQ_D_if_new_NEQ_if_new_0_2_NEQ_goto_syntax_if_i_type_NEQ_D_if_old_NEQ_if_old_0_2_NEQ_goto_syntax_if_i_type_EQU_H_set_Holdsrv_old_amp_set_Hnewsrv_new_amp_goto_test2_if_i_type_EQU_P_set_Poldsrv_old_amp_set_Hnewsrv_new_amp_goto_test2_if_i_type_EQU_D_set_Holddrv_old_amp_set_Hnewdrv_new_amp_goto_test2_goto_syntax_test2_if_2_">\{\} goto syntax
set sam=
set Holdsrv=#
set Hnewsrv=#
set Poldsrv=#
set Pnewsrv=#
set Holddrv=#
set Hnewdrv=#
set param=%1
for /f "Tokens=1-3 Delims=:" %%a in ('@echo %1') do (
 set type=%%a
 set old=%%b
 set new=%%c
)
if "%param:~1,2%" EQU "::" set new=%old%&set old=
if /i "%type%" NEQ "D" if "%new%" NEQ "" if "%new:~0,2%" NEQ "\\" goto syntax
if /i "%type%" NEQ "D" if "%old%" NEQ "" if "%old:~0,2%" NEQ "\\" goto syntax
if /i "%type%" EQU "H" set Holdsrv=%old%&set Hnewsrv=%new%&goto test2
if /i "%type%" EQU "P" set Poldsrv=%old%&set Hnewsrv=%new%&goto test2
if /i "%type%" EQU "D" set Holddrv=%old%&set Hnewdrv=%new%&goto test2
goto syntax
:test2
if \{%2\}</a></h1>\{\} goto test3
set param=%2
for /f "Tokens=1-3 Delims=:" %%a in ('@echo %2') do (
 set type=%%a
 set old=%%b
 set new=%%c
)
if "%param:~1,2%" EQU "::" set new=%old%&set old=
if /i "%type%" NEQ "D" if "%new%" NEQ "" if "%new:~0,2%" NEQ "\\" goto syntax
if /i "%type%" NEQ "D" if "%old%" NEQ "" if "%old:~0,2%" NEQ "\\" goto syntax
if /i "%type%" EQU "H" set Holdsrv=%old%&set Hnewsrv=%new%&goto test3
if /i "%type%" EQU "P" set Poldsrv=%old%&set Pnewsrv=%new%&goto test3
if /i "%type%" EQU "D" set Holddrv=%old%&set Hnewdrv=%new%&goto test3
goto syntax
:test3
if \{%3\}==\{\} goto doit
set param=%3
for /f "Tokens=1-3 Delims=:" %%a in ('@echo %3') do (
 set type=%%a
 set old=%%b
 set new=%%c
)
if "%param:~1,2%" EQU "::" set new=%old%&set old=
if /i "%type%" NEQ "D" if "%new%" NEQ "" if "%new:~0,2%" NEQ "\\" goto syntax
if /i "%type%" NEQ "D" if "%old%" NEQ "" if "%old:~0,2%" NEQ "\\" goto syntax
if /i "%type%" EQU "H" set Holdsrv=%old%&set Hnewsrv=%new%&goto doit
if /i "%type%" EQU "P" set Poldsrv=%old%&set Pnewsrv=%new%&goto doit
if /i "%type%" EQU "D" set Holddrv=%old%&set Hnewdrv=%new%&goto doit
goto syntax
:doit
if "%Hnewsrv%" EQU "" set Hnewsrv=nul
if "%Pnewsrv%" EQU "" set Pnewsrv=nul
if "%Hnewdrv%" EQU "" set Pnewsrv=nul
if "%Hnewdrv%" EQU "#" if "%Hnewsrv%" NEQ "#" goto syntax
if "%Hnewdrv%" NEQ "#" if "%Hnewsrv%" EQU "#" goto syntax
set qry1=dsquery * domainroot -filter
set qry2= "(&(objectCategory=Person)(objectClass=User))"
set qry3= -attr distinguishedName sAMAccountName homeDrive homeDirectory profilePath -L -limit 0
set qry=%qry1%%qry2%%qry3%
set OK=N
for /f "Tokens=1*" %%a in ('%qry%') do (
 set attr=%%a
 set value=%%b
 call :test1
)
endlocal
goto :EOF
:err
@echo Logic - User:%user%
goto :EOF
:syntax
@echo ChgSrv H:OldSrv1:NewSrv1 D:OldDrv:NewDrv P:OldSrv2:NewSrv2
endlocal
goto :EOF
:test1
if /i "%attr%" EQU "distinguishedName:" set user=%value%&goto :EOF
if /i "%attr%" EQU "sAMAccountName:" set sam=%value%&goto :EOF
if /i "%attr%" EQU "homeDirectory:" set home=%value%&goto :EOF
if /i "%attr%" EQU "homeDrive:" set drive=%value%&goto :EOF
if /i "%attr%" NEQ "profilePath:" goto err
set prof=%value%
set OK=N
set newhome=%home%
set newprof=%prof%
set newdrv=%drive%
if "%drive%" NEQ "" (
 if "%Holddrv%" NEQ "" call set newdrv=%%drive:%Holddrv%=%Hnewdrv%%%
) ELSE (
 if "%Holddrv%" EQU "" call set newdrv=%Hnewdrv%
)
call set old=%Holdsrv%
call set new=%Hnewsrv%
if "%old%" NEQ "" call set old=%%old:$sam$=%sam%%%
if "%new%" NEQ "" call set new=%%new:$sam$=%sam%%%
if "%home%" NEQ "" (
 if "%old%" NEQ "" call set newhome=%%home:%old%=%new%%%
) ELSE (
 if "%old%" EQU "" call set newhome=%new%
)
call set old=%Poldsrv%
call set new=%Pnewsrv%
if "%old%" NEQ "" call set old=%%old:$sam$=%sam%%%
if "%new%" NEQ "" call set new=%%new:$sam$=%sam%%%
if "%prof%" NEQ "" (
 if "%old%" NEQ "" call set newprof=%%prof:%old%=%new%%%
) ELSE (
 if "%old%" EQU "" call set newprof=%new%
)
if "%newhome%" EQU "#=#" set newhome=
if "%newprof%" EQU "#=#" set newprof=
if "%newdrv%" EQU "#=#" set newdrv=
if "%newhome%" EQU "#" set newhome=
if "%newprof%" EQU "#" set newprof=
if "%newdrv%" EQU "#" set newdrv=
if "%home%" NEQ "%newhome%" set OK=Y
if "%prof%" NEQ "%newprof%" set OK=Y
if "%drive%" NEQ "%newdrv%" set OK=Y
if "%OK%" EQU "N" goto :EOF
if "%newhome%" EQU "nul" if "%Holdsrv%" NEQ "" set newhome=-hmdir ""&goto out1
if "%newhome%" NEQ "" if "%Holdsrv%" NEQ "" set newhome=-hmdir "%newhome%"&goto out1
if "%newhome%" NEQ "" if "%Holdsrv%" EQU "" set newhome=-hmdir "%newhome%"
:out1
if "%newprof%" EQU "nul" if "%Poldsrv%" NEQ "" set newprof=-profile ""&goto out2
if "%newprof%" NEQ "" if "%Poldsrv%" NEQ "" set newprof=-profile "%newprof%"&goto out2
if "%newprof%" NEQ "" if "%Poldsrv%" EQU "" set newprof=-profile "%newprof%"
:out2
if "%newdrv%" EQU "nul" if "%Holddrv%" NEQ "" set newdrv=-hmdrv ""&goto out3
if "%newdrv%" EQU ":" if "%Holddrv%" NEQ "" set newdrv=-hmdrv ""&goto out3
if "%newdrv%" NEQ "" set newdrv=%newdrv::=%:
if "%newdrv%" NEQ "" if "%Holddrv%" NEQ "" set newdrv=-hmdrv %newdrv%&goto out3
if "%newdrv%" NEQ "" if "%Holddrv%" EQU "" set newdrv=-hmdrv %newdrv%
:out3
if /i "%sam%" NEQ "test" goto :EOF
@echo dsmod user "%user%" %newdrv% %newhome% %newprof%
dsmod user "%user%" %newdrv% %newhome% %newprof%