Go Back   PackageDeploy Application Packaging Forums > Package Development > Application Deployment > Microsoft SMS 2003

Reply
 
LinkBack Thread Tools Display Modes
Old 12-19-2008, 03:35 AM   #1 (permalink)
Rich
Guest
 
Posts: n/a
Default Script to change SMS Site Code

Does anyone have a login script that i could add into a GPO to change the
site code on all my workstations?
  Reply With Quote
Old 12-19-2008, 03:35 AM   #2 (permalink)
Tom Watson
Guest
 
Posts: n/a
Default RE: Script to change SMS Site Code



"Rich" wrote:

> Does anyone have a login script that i could add into a GPO to change the
> site code on all my workstations?


Try this:-

<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>

' SiteChange.VBS - Force the SMS 2003 site
' Usage:
' Usage: SiteChange.VBS <SiteCode>


on error resume next

'
' Get site code
'
strNewSite = ucase(WScript.Arguments(0))

'
' Connect to the machine's CCM namespace
'
Set oSMSClient = GetObject("winmgmts://./root/ccm:SMS_Client")

'
' Set the machine's new site code
'
Set inParam =
oSMSClient.Methods_.Item("SetAssignedSite").inPara meters.SpawnInstance_()
inParam.sSiteCode = strNewSite
Set result = oSMSClient.ExecMethod_("SetAssignedSite", inParam)

<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>

You need to supply one parameter, namely the new 3 letter site code.

Regards,
Tom Watson
  Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:55 PM.


vBulletin, Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
2007 - 2012 PackageDeploy.com