Skip to main content

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

Comments

Popular posts from this blog

DP Content checking

--DP content status: use sms SELECT     v_PackageStatusDistPointsSumm.PackageID,                       v_Package.Name, v_PackageStatusDistPointsSumm.InstallStatus, v_PackageStatusDistPointsSumm.SiteCode, v_PackageStatusDistPointsSumm.ServerNALPath,                       v_PackageStatusDistPointsSumm.SourceVersion, v_PackageStatusDistPointsSumm.State, v_PackageStatusDistPointsSumm.LastCopied,                       v_PackageStatusDistPointsSumm.SourceNALPath, v_PackageStatusDistPointsSumm.SummaryDate FROM         v_PackageStatusDistPointsSumm INNER JOIN                       v_Package ON v_PackageStatusDistPointsSumm.PackageID = v_Package.PackageID WHERE     (v_PackageStatusDistPointsSumm.ServerNALPath LIKE '%XXX%')---and InstallStatus <> 'Package Installation complete' --WHERE     (v_PackageStatusDistPointsSumm.ServerNALPath LIKE '%.stores.target.com%')and InstallStatus <> 'Package Installation complete' --and Name like '%neil%&

Pull Dp concept

When a package is distributed to a PullDP, DistMgr creates a PkgXferMgr job and added to the queue. - PkgXferMgr processes the job and creates a PullDP notification in the PullDPs WMI. - PullDP reads the notification and starts the download from a assigned Standard DP based on priority. - Once the notification is written, PkgXferMgr monitors the job for next 10 hours (max value hardcoded). Every 60 mins. - If the status is not received from the PullDP, it will mark the distribution as Failed and it creates a Status Message and DistMgr processes the message. - if a package is successfully downloaded in the PullDP, even after it exceeds the 10 hours, it will send the status to MP and it will drop a file in Distmgr.box. - DistMgr will check the existing status in the PkgStatus table. - Since the PkgXferMgr already dropped a failed status, it will ignore the status which has been sent by PullDP. - So the status will stay as failed. But content is distributed. However clients won’t work d