Jan
25

Upgrade ConfigMgr 2007 clients to SP2 using one program in a multi primary site hierarchy

By

When upgrading ConfigMgr 2007 clients to SP2 there could be a problem upgrading the clients using one program. This because if you use the ccmsetup switch SMSSITECODE=AUTO users travelling between different locations can be accidentally reassigned to the primary site at the location where the client was located during the actual upgrade, that could cause advertisements to run again on the client. Why using one program you think, well using one program will ease you administration effort doing the upgrade because you can use one collection for all clients. Finally to the solution, I made a script that queries the client’s assigned site code and then uses this for the ccmsetup parameter SMSSITECODE, if there are no assigned site code AUTO is used. Put this script in the source folder of your ConfigMgr 2007 SP2 client and run the script as the installation command. Please remember that the script is delivered AS IS without any warranties.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Option Explicit
On Error Resume Next
 
Dim cmclient,WshShell,wshFSO,strSiteCode,strExitCode,strCmdLine
 
Set cmclient = CreateObject("Microsoft.SMS.Client")
Set WshShell = CreateObject("WScript.Shell")
Set wshFSO = CreateObject("Scripting.FileSystemObject")
 
strSiteCode  = cmclient.GetAssignedSite
 
If strSiteCode <> "" then
	strCmdLine = SourceDir & "\Ccmsetup.exe /noservice SMSSITECODE=" & strSiteCode
	strExitCode = WshShell.Run(strCmdLine, 0, True)
	WshShell.LogEvent 0, "ConfigMgr 2007 SP2 client upgrade executed command: """ & strCmdLine & """" & CHR(10) & "Exitcode: " & CSTR(strExitCode)
Else
	strCmdLine = SourceDir & "\Ccmsetup.exe /noservice SMSSITECODE=AUTO"
	strExitCode = WshShell.Run(strCmdLine, 0, True)
	WshShell.LogEvent 0, "ConfigMgr 2007 SP2 client upgrade executed command: """ & strCmdLine & """" & CHR(10) & "Exitcode: " & CSTR(strExitCode)
End if
 
Function SourceDir
	SourceDir = Left(WScript.ScriptFullName,Len(WScript.ScriptFullName) - Len(WScript.ScriptName) -1)
End Function
 
wscript.quit(strExitCode)

Comments

  1. [...] Upgrade ConfigMgr 2007 clients to SP2 using one program in a multi primary site hierarchy :: Litware Filed under: System Center, ConfigMgr 2007 [...]

  2. Anders Keis Hansen says:

    Super info Jonas :)

Leave a Reply