Tuesday, August 15, 2006

Exchange 2003 SP2 move mailbox issue (Guid-ReplID Caching) Part 2

This little script will do all the work for you.. Some of our servers have nine stores so this takes a second to run as opposed to minutes doing it manually.


const HKEY_LOCAL_MACHINE = &H80000002
If (Wscript.Arguments.Count)<>2 Then
WScript.Echo ("Usage : cscript guidstore.vbs -s ")
WScript.Quit(1)
End If
If lcase(WScript.Arguments(0))="-s" Then
strcomputer=WScript.Arguments(1)
End If

Set StdOut = WScript.StdOut

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Services\MSExchangeIS\" & strcomputer
oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys
For Each subkey In arrSubKeys
StdOut.WriteLine subkey
SubKeys = "SYSTEM\CurrentControlSet\Services\MSExchangeIS\" & strcomputer & "\" & subkey
strValueName = "Guid-Replid Caching"
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,SubKeys,strValueName,dwValue
Next

No comments: