TechnicallyChris.com

Technical and Personal Ramblings of a Bostonian
  • Home
  • About Chris
  • Donate
  • Contact Chris
Home > Random Code > Creating an SMS 2003 CCR within Excel

Creating an SMS 2003 CCR within Excel

July 6th, 2009
Goto comments Leave a comment

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

If you enjoyed this article or it helped you in any way, I’d appreciate it if you’d post a comment below to let me know. All code examples are for demonstration only and should be used at your own risk. I cannot accept liability for unexpected results.

Chris Random Code Microsoft Office, SMS 2003, VBA

Comments (0) Trackbacks (0) Leave a comment Trackback
  1. No comments yet.
  1. No trackbacks yet.
Subscribe to comments feed
Bush’s Summer Home in Kennebunkport, ME How to Ping a Computer from Excel
RSS feed
  • Google
  • Youdao
  • Xian Guo
  • Zhua Xia
  • My Yahoo!
  • newsgator
  • Bloglines
  • iNezha

Sponsored By

Recent Posts

  • Just Bought the Google Nexus One
  • Seven Things I’ve Liked About Windows 7 in Seven Day
  • What’s Happened to Customer Service (Part 2)?
  • What’s Happened to Customer Service (Part 1)?
  • Capturing S.M.A.R.T. Hard Disk Data from WMI with AutoIt
  • Adjusting DCOM Settings via Script
  • How to Manually Call the Google Cache
  • RoboForm & RoboForm2Go Product Review
  • Updated PingCell Function for Excel
  • Creating Hyperlinks in Word and Excel Longer than 256 Characters

Categories

  • ColdFusion
  • Firefox
  • Google Nexus One
  • IIS
  • McAfee EE / SafeBoot
  • Microsoft Windows
  • Oracle
  • Random Code
  • Random Technology
  • Sports and Recreation
  • Subversion
  • The Untechnological

Archives

  • January 2010
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • October 2007
  • September 2007
  • August 2007
  • January 2007
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006

Meta

  • Register
  • Log in
PageRank
Top WordPress
Copyright © 2006-2010 TechnicallyChris.com
Theme by mg12. Valid XHTML 1.1 and CSS 3.