Monday, January 12, 2009

SCCM Client: Patch Managemnt to Force Client Deployement on remote systems

To Force Client Deployment
================================================================================================================================================================
 
    ' Set the required variables.
    actionNameToRun = "Software Updates Assignments Evaluation Cycle"
    ' Create a CPAppletMgr instance.
    Dim oCPAppletMgr
    Set oCPAppletMgr = CreateObject("CPApplet.CPAppletMgr")
    ' Get the available ClientActions object.
    Dim oClientActions
    Set oClientActions = oCPAppletMgr.GetClientActions()
    ' Loop through the available client actions. Run the matching client action when it is found.
    Dim oClientAction
    For Each oClientAction In oClientActions
        If oClientAction.Name = actionNameToRun Then
            oClientAction.PerformAction 
        End If
    Next
      
================================================================================================================================================================
Save the script into Force_Deployment.vbs.vbs
 
====================================================================================================================
The above script will run on only local system. Ofcourse every one wants to run this in remote systems so i created a batch file to run on targeted list of systems ... Here is the Batch file....
===========================================================================
xcopy /y Force_Deployment.vbs \\%1\admin$\temp\
psexec \\%1 \\%1\admin$\temp\Force_Deployment.vbs
===========================================================================
Save the above Batch File with the Name sup.bat

and the synatx to call the batch file is  ""For /F %a in (list.txt) do SUP.bat %a"""" Include systems name in list.txt file
==========================================================================

-------------------
Thanks,
http://sccm07.blogspot.com/

No comments: