script for site assignment (Full Version)

All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager



Message


cxesam -> script for site assignment (6/19/2008 7:44:17 AM)

Hi

Does anyone perhaps know of a script i can use for my site assignments? I have a situation where my sccm clients are still reporting to my old site code (old sms server). I've disabled all function on my old server and deleted the SLP in my AD container. I need a "quick method" to rectify this. Any ideas please?




wbracken -> RE: script for site assignment (6/19/2008 8:45:54 AM)

Here's a script I used when I rebuilt the SMS 2003 infrastructure here.  Not tested against SCCM but worth a try:
*note the optinal CacheSize routine...you can leave that part out.

' =============================================================================
' /// Info
' =============================================================================
' USAGE: SMS CLIENT Redirect
' ScriptVersion = "1.0"
' =============================================================================
On Error Resume Next
Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")
Computer = WSHShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
' =============================================================================    
'/// Prevent script from running on Current SMS Server (stl)
' =============================================================================
If Computer = "MYOLDSMSSERVER" Then
WScript.Quit
End if
' =============================================================================
' /// Set SMS SITE CODE to 001
' =============================================================================
Set smsClient = CreateObject("Microsoft.SMS.Client")    
smsClient.SetAssignedSite "001", 0
Set smsClient = Nothing
' =============================================================================
' /// Set Cache to 2048
' =============================================================================
Dim oUIResManager 
Dim oCache, CacheSize
CacheSize = 2048
Set oUIResManager = CreateObject("UIResource.UIResourceMgr")
If oUIResManager Is Nothing Then
   WScript.Quit
End If
Set oCache=oUIResManager.GetCacheInfo
If oCache Is Nothing Then
   Set oUIResManager=Nothing
WScript.Quit
End If
oCache.TotalSize=CacheSize
WScript.Quit




cxesam -> RE: script for site assignment (6/19/2008 9:02:27 AM)

Thanks William. I'll give it a try and will let you know. I'm opting to use GP as well as a last resort if all else fails.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.703125