VBScript to Set your SMS 2003 Advanced Client Site Code
Simple script to change site code on a client.
----Begin VBScript----
On Error Resume Next
'Your site code goes here
siteCode = "xyz"
Dim oSMSClient
Set oSMSClient = CreateObject ("Microsoft.SMS.Client")
If Err.Number <> 0 Then
WScript.quit
End If
oSMSClient.SetAssignedSite siteCode
Set oSMSClient=Nothing
----End VBScript----
----Begin VBScript----
On Error Resume Next
'Your site code goes here
siteCode = "xyz"
Dim oSMSClient
Set oSMSClient = CreateObject ("Microsoft.SMS.Client")
If Err.Number <> 0 Then
WScript.quit
End If
oSMSClient.SetAssignedSite siteCode
Set oSMSClient=Nothing
----End VBScript----
About the Author
Emmanuel Tsouris is a Systems Management veteran and Developer Advocate specializing in PowerShell and Cloud Automation. He maintains DotVBS to preserve legacy knowledge for the "archaeologist admin."
Ready to move from VBScript to the Cloud? Check out his book, Pro PowerShell for Amazon Web Services.
Visit EmmanuelTsouris.com for his latest projects.
As an Amazon Associate, I earn from qualifying purchases at no cost to you.
Comments