Do you need to remove the old service, or simply repoint it at a new server/mailbox name?
I have an old script somewhere that repointed the Personal Address Book to a new path - it might be of some use.
code:
;Check whether the migration has been run before - only continue if not
IF READVALUE("HKEY_LOCAL_MACHINE\Software\GNIComms\MigratePab","Status")
GOTO END
ENDIF
;First we check the default mail profile in use
$DefaultProfile = READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles","DefaultProfile")
;Now we hunt through the configured services for the Personal Address Book entries
$Index = 0
:Loop1
$ServiceName = ENUMKEY("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\$DefaultProfile\", $Index)
IF @ERROR = 0
IF READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\$DefaultProfile\$ServiceName","001e3001") = "Personal Address Book"
$PabPath = READVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\$DefaultProfile\$Servicename","001e6600")
IF @ERROR = 0
GOTO MigratePab
ENDIF
ENDIF
$Index = $Index + 1
GOTO Loop1
ENDIF
;This subroutine will actually copy the PAB file currently in use to the new location (Home directory, etc)
;and then repoint the users mail profile to the copy. The original will be left intact - just in case it is
;needed. It can be removed later if there are no issues.
:MigratePab
$NewLocation = "\\server\share\@USERID.pab" ;This will be set properly for the live script
COPY $PabPath $NewLocation
$Nul = WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\$DefaultProfile\$ServiceName","001e6600","$NewLocation","REG_SZ")
IF $Nul = 0
$Nul = ADDKEY("HKEY_LOCAL_MACHINE\Software\GNIComms\MigratePab")
$Nul = WRITEVALUE("HKEY_LOCAL_MACHINE\Software\GNIComms\MigratePab","Status","Migrated PAB successfully on @DATE at @TIME.","REG_SZ")
ENDIF
;Send email confirmation in addition to local machine registry tag
GLOBAL $Subject
$Subject = "Confirmation: PAB successfully migrated for @USERID to $NewLocation
GLOBAL $Message
$Message = ""
CALL "%0\..\GNISCRIPTS\sendmail.kix"
:END
EXIT
You would have to manually check the service ID for the Exchange Server services, or simply enumerate the registry keys looking for the name of the old server and replacing it where necessary.
You can ignore the sendmail.kix part at the end of this - its just a script that calls Postie.exe using a preconfigured setup, and nearly all my scripts use it to send me automated updates and info
Hope this might offer some ideas, though.
[ 22 July 2002, 16:02: Message edited by: Breaker ]