That's easy then:


$sKeyName="HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\OMI Account Manager\Accounts\00000001"
$sValueName="SMTP Server"

$sOldServer="xxx.yyyyyyyyyy.zzz"
$sNewServer="aaa.bbbbbbbbbb.ccc"

If ReadValue($sKeyName,$sValueName)=$sOldServer $sIgnore=WriteValue($sKeyName,$sValueName,$sNewServer,"REG_SZ") EndIf



This will obviously only work if the sub-key always ends "0000001".

You may need to use EnumKey() to check each of the keys if it does not remain the same. If you get stuck, post again.