Brian (from Microsoft) provided information about the command options that will hopefully allow us to use the CCMSetup executable from the logon script to upgrade our SMS clients. Below is an excerpt that describes the command and how it is used.
SMSCONFIGSOURCE Specifies where and in what order the Advanced Client Installer checks for configuration settings. The property is a string containing one or more characters, each defining a specific configuration source. Use the character values R, P, M, and U, alone or in combination, as shown in the examples below. By default, the client installation uses PU to check first the installation properties and then the existing settings.
Use R to instruct the client installation program to check for configuration settings in the registry:
Ccmsetup.exe SMSCONFIGSOURCE=R
Use P to instruct the client installation program to check for configuration settings in the installation properties provided on the command line:
Ccmsetup.exe SMSCONFIGSOURCE=P
Use M to instruct the client installation program to check for configuration settings when you are replacing an existing SMS 2.0 client or Legacy Client with the Advanced Client (uses the existing site code):
Ccmsetup.exe SMSCONFIGSOURCE=M
Important
Do not use the M value on SMSCONFIGSOURCE if you are upgrading any SMS 2.0 or SMS 2003 Legacy Clients that are currently assigned to an SMS 2.0 secondary site. These clients will become orphaned because Advanced Clients cannot be assigned to secondary sites.
Use U to upgrade the Advanced Client to a newer version of the Advanced Client (uses the assigned site code):
Ccmsetup.exe SMSCONFIGSOURCE=U
To use multiple configuration sources, specify multiple characters. For example, use RP to force the client installation program to first check for configuration options in the registry and then check the installation properties on the command line:
Ccmsetup.exe SMSCONFIGSOURCE=RP
When you are installing Advanced Clients, specify the SMSCONFIGSOURCE property with the options in the order that is most appropriate for your deployment plan so clients have the maximum opportunity to find a suitable site code and client type. For example, you might use PUM so that if the installation is an upgrade from the Legacy Client or an older version of the Advanced Client, the existing site code is used. However, the administrator can still override the existing site code on the command line by using the SMSSITECODE property. See the Important note about the M value, earlier in this section, before you use this property during a client upgrade.
Code:
;FUNCTION SMS2003()
;
;AUTHOR Howard A. Bullock (hbullock@tycoelectronics.com)
;
;ACTION Performs required actions for installing SMS client
;
Function SMS2003()
Writelog("SMS2003: Start")
;define local variables
Dim $DialupStatus,
$VPNStatus,
$ClientType,
$SiteCode,
$SiteStatus,
$ClientVer,
$SMSkey,
$CapInstProg,
$RC
$DialupStatus = @RAS
$VPNStatus = val(ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Cisco Systems\VPN Client", "TunnelEstablished"))
;exclude RAS clients, VPN clients, and Servers
if $DialupStatus or $VPNStatus or IsServer()
Writelog("SMS2003: Exiting because one or more are true - DialupStatus=" + $DialupStatus + " VPNStatus=" + $VPNStatus + " IsServer()=" + IsServer())
exit 1
endif
$SMSkey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS"
$CapInstProg = @Lserver + "\netlogon\corp\sms\i386\capinst.exe"
;determine client type
$ClientVer = ReadValue($SMSkey + "\Client\Client Components\SMS Client Base Components\Installation Properties", "Installed Version")
Select
Case Left($ClientVer,5) = "2.00." $ClientType = "OLDLegacy"
Case Left($ClientVer,5) = "2.50." $ClientType = "NEWLegacy"
Case Left($ClientVer,2) = "9." $ClientType = "Advanced"
Case 1 $ClientType = "NoClient"
Endselect
Writelog("SMS2003: ClientType=" + $ClientType)
$SiteCode = ""
Select
Case $ClientType = "Advanced" $SiteCode = ReadValue($SMSkey + "\Mobile Client", "AssignedSiteCode")
Case 1 $SiteCode = "" + ENUMKEY($SMSKey + "\Client\Sites\System", 0)
Endselect
Writelog("SMS2003: SiteCode=" + $SiteCode)
if $SiteCode = ""
$ClientType <> "NoClient"
Writelog("SMS2003: Setting to NoClient because there was no SiteCode assigned.")
endif
if $ClientType <> "Advanced"
;process clients that DO NOT have an SMS client installed or have no sitecode
Writelog("SMS2003: processing computer as '" + $ClientType + "'")
Select
Case Val(@DOS ) >= 5 ;W2K and above
;install advanced client
ShellProg($CapInstProg, "/SLP=ServerName /Advcli /AdvCliCmd SMSCACHESIZE=1024")
Case (Left(@ProductType, 10) = "Windows NT" or @ProductType = "Windows 98") and $ClientType <> "NEWLegacy"
;install NewLegacy client
ShellProg($CapInstProg, "/SLP=ServerName")
Case 1 ;Unknown case
Writelog("Unhandled case 1: @@DOS = " + @DOS + " No action taken to install SMS client")
Endselect
endif
if $ClientType = "Advanced"
; $CCMEXEver is a global defined from LogClientDetails()
if $CCMEXEver <> "2.50.3174.1152"
;do staggered 20 percent per day for initial installation
Dim $Date, $TargetDate
$TargetDate = 20051014
$Date = 0 + (substr(@Date,1,4)+substr(@Date,6,2)+substr(@Date,9,2))
if $Date < $TargetDate or $Date > ($TargetDate + Val(Right(Enumipinfo(0,0),1))/2)
ShellProg($CapInstProg, "/SLP=ServerName /Advcli /AdvCliCmd SMSCONFIGSOURCE=U")
endif
endif
endif
Writelog("SMS2003: Complete")
Endfunction
This code is from LogClientDetails() that pertains to the above code.
Code:
;SMS Installation
Dim $CEN, $SMS, $ClientVer, $SMSkey
Global $CCMEXECver
;determine client type
$SMSkey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS"
$ClientVer = ReadValue($SMSkey + "\Client\Client Components\SMS Client Base Components\Installation Properties", "Installed Version")
;CHANGE THIS TO CCMEXEC.EXE file version
$file = "%windir%\system32\CCM\CCMEXEC.exe"
if exist ($file)
$CCMEXECver = GETFILEVERSION ($file,"FileVersion")
$CCMEXECver = left($CCMEXECver,instr($CCMEXECver," ")-1)
endif