Advertisement Tools - Change Site Code
Main Menu
>
Tools
>
Advertisement Tools
Change Site Code
Use this to change the site code of a client computer.
Code
Method #1 NewSiteCode = "XYZ" sMachine = "." set oCCMNamespace = GetObject("winmgmts://" & sMachine & "/root/ccm") Set oInstance = oCCMNamespace.Get("SMS_Client") set oParams = oInstance.Methods_("SetAssignedSite").inParameters.SpawnInstance_() oParams.NewSiteCode = NewSiteCode oCCMNamespace.ExecMethod "SMS_Client", "SetAssignedSite", oParams method #2 Set smsclient=CreateObject("Microsoft.SMS.Client") smsclient.SetAssignedSite("XYZ") --------------------------------------------------------
Documentation
Here are the two common ways to push down a site code change. This could easily be rewritten to a right click tool. Refer to the right click action tools to do a remote WMI call or copy a file and do a remote execute on it.