Friday, May 25, 2012

SMS/SCCM Client Install Script automation



1. Create a folder anywhere in same domain and copy the ccmsetup.exe and psexec.exe to the folder.
2. Create a text file with name computers.txt under C:\ and enter the system names one by one where you wanted to install the SMS Client.
3. Copy the below script and name it as SCCMClientInstall.vbs
4. Double click the file.
5. Enter the Path of the folder that you created in the first step and click ok.
6. Enter the Management Point Name in the next input box. (You can mention any MP name)
7. Check the ccmsetup.log in one machine to verify the client install.





dim strComputer,strListPath
dim objTSL,objFSO
dim strMP,filePath

If filePath = "" Then
   filePath = InputBox("Enter CCMSetup.exe Path", "CCMSetup SourceLocation", filePath)
End If

If strMP = "" Then
   strMP = InputBox("Enter the MP name", "Management Point Name", strMP)
End If


Set sho = WScript.CreateObject("WScript.Shell")

strListPath = ""

Set objFso = CreateObject("Scripting.FileSystemObject")
Set objTsL = objFso.OpenTextFile(strListPath & "C:\computers.txt",1)

Do Until objTsL.AtEndOfStream

strComputer = objTsL.ReadLine
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery _
    ("Select * from Win32_PingStatus " & _
        "Where Address = '" & strComputer & "'")
For Each objItem in colItems
    If objItem.StatusCode = 0 Then

sho.Run "xcopy.exe /y "& filePath &"\ccmsetup.exe \\" & strComputer & "\admin$\"


sho.Run ""& filePath &"\psexec.exe \\" & strComputer & " -s C:\WINDOWS\ccmsetup.exe /service /mp:" & strMP & " SMSSITECODE=AUTO"

End if

Next

Loop

No comments:

Post a Comment

SCCM to Tanium

SCCM transition Options: of course intune otherwise  Deployment, Patching - Tanium Image - Tazier Inventory - Tanium Remote Control - Zoom  ...