Change SMS Site Code VBS Script

The following VBS script can be used to change an SMS site code.

By using this script you won’t need to reinstall the SMS client application.

'replace with your Site Code 
sSiteCode = "XYZ"
sMachine = "."
set oCCMNamespace = GetObject("winmgmts://" & sMachine & "/root/ccm")
Set oInstance = oCCMNamespace.Get("SMS_Client")
set oParams = oInstance.Methods_("SetAssignedSite").inParameters.SpawnInstance_()
oParams.sSiteCode = sSiteCode
oCCMNamespace.ExecMethod "SMS_Client", "SetAssignedSite", oParams