I have seen many examples over the years discussing the scripting of CCRs to push SMS clients but I’ve never seen one using CCRs submitted to MPs.
So what is a CCR anyway? A CCR is a text file, usually created by SMS, that is read by the SMS_CLIENT_CONFIG_MANAGER (CCM) thread of the SMS Executive (SMSEXEC) service. The CCM thread then uses the information in the CCR to push the SMS Client to a machine.
CCRs are created when you use the “Client Push Installation Wizard” or try to install a client under the context of the logged on user and that user doesn’t have the appropriate rights to complete the installation. When the logged on user doesn’t have rights the installation sends a request to the SMS 2003 MP so that a CCR gets created and the client gets installed from the server. This is a simple http request which is handled on the MP by an ISAPI filter installed when the SMS 2003 MP was first setup. You can view this ISAPI in IIS Manager and also see the request logged in the IIS logs on the MP.
Each CCR contains several properties. To view the properties of a CCR simply stop the SMS Executive service on your site server and install a client using the “Client Push Installation Wizard”. After doing this you should have a <machinename>.ccr in your SMS\inboxes\ccr.box directory which you can open in notepad. Previous methods of scripting the creation of CCRs involved creating the actual file and copying it to the Logon Point (SMS 2.0), the Client Access Point (CAP), or directly into the ccr.box directory. This method may fit better in some environments where file shares have been locked down.
The one CCR property which isn’t obvious, but very important, is the “Forced CCR” property. This tells CCM whether or not to reinstall the SMS client if it is already installed. Setting the bForcedCCR variable to TRUE in the VBScript example below will cause CCM to reinstall the client you specify.
'Fill in the variables with the appropriate information
sMP = "MYSMSMP"
sDomain = "MYSMSDOMAIN"
sClient = "MYSMSCLIENTBOX"
bForcedCCR = TRUE
'iClientType = 1 'ct= -1=Auto, 0=Desktop, 1=Advanced
'bDC = TRUE
sQuery = "http://" & sMP & "/sms_mp/machine.ccr?mn="_
& sClient & "&dn=" & sDomain & "&fkey=" & bForcedCCR
Set xmlHttp = CreateObject("Microsoft.XMLHTTP")
xmlHttp.Open "SMS_POST", sQuery, False
If xmlHttp.Status = 200 Then
WScript.Echo "CCR generated for " & sClient
WScript.Echo "Error generated CCR for " & sClient
WScript.Echo "Http Status = " & xmlHttp.Status
Set xmlHttp = Nothing
When creating a CCR via an MP you currently cannot specify the “Client Type” or “PushClientEvenIfDC” properties because of the problem documented in KB886055. The default is always advanced client and not to install on DCs.
To execute the code above simply copy/paste the code above into a file with the extension of .vbs, edit the variables at the top to include your environment specific information, save the file, and run it. Use the attached flowchart to understand how CCRs created via MPs work.