Creating an SMS 2003 CCR within Excel
I created the following function to create Microsoft SMS 2003 Client Configuration Requests from within Excel and dump them all out into a temporary directory for me to copy to the SMS inbox. For those that are unaware, you can “ask” SMS 2003 to remotely install the client by putting a CCR file into the INBOXES\CCR.BOX folder on the SMS Site server.
Basically you just select your range of computer names, execute this sub, and it’ll let you know where the CCRs were generated (in a temporary folder). Just take a peek, copy them out to the CCR.BOX folder and (if SMS is setup correctly) you’re good to go!
You’re free to use this as you see fit and to distribute as you like. I would appreciate if you’d leave the header intact and link back here if possible.
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | Public Sub CreateSMSCCR() ' Version: 0.1 (First Release) ' Excel Version: 2003 ' Language: English ' Description: Function that creates a CCR for SMS 2003 from Excel ' http://www.TechnicallyChris.com/ ' 30-Jun-2009: Created Function Dim r As Range Dim strComputer As String Dim strError As String Dim strMsg As String Dim fn As Integer Dim tmp As String tmp = Date & " " & Time tmp = Replace(tmp, ":", " ") tmp = Replace(tmp, "/", "-") tmp = Replace(tmp, "\", "-") tmp = Environ("TEMP") & "\XLSCCR_" & tmp MkDir (tmp) For Each r In Application.Selection strComputer = r.Value If strComputer = "" Then strError = strError & " Skip " & r.Address & ": <blank>" & vbCrLf ElseIf InStr(strComputer, Chr(32)) > 0 Then strError = strError & " Skip " & r.Adderss & ": Has Space" & vbCrLf ElseIf InStr(strComputer, ".") > 0 Then strError = strError & " Skip " & r.Adderss & ": Has Period" & vbCrLf Else fn = FreeFile Open tmp & "\" & strComputer & ".ccr" For Output As #fn Print #fn, "[NT Client Configuration Request]" Print #fn, "Client Type=1" Print #fn, "Forced CCR=TRUE" Print #fn, "Machine Name=" & strComputer Close #fn End If Next r If strError <> "" Then strMsg = "The following errors occured:" & vbCrLf & vbCrLf & strError & vbCrLf End If strMsg = strMsg & "Successful CCRs stored in " & tmp MsgBox strMsg, vbOKOnly + vbInformation, "CCR Generator" End Sub |