12 January 2009

SCCM Client Discovery Data Cycle intiate on remote systems

To intiate Discovery Data Cycle run this Script:---
==================================================================================================================================================================
 
On Error Resume Next
Dim oCPAppletMgr
Set oCPAppletMgr = CreateObject("CPApplet.CPAppletMgr")
Dim oClientActions
Set oClientActions = oCPAppletMgr.GetClientActions()
Dim oClientAction
For Each oClientAction In oClientActions
If oClientAction.Name = "Discovery Data Collection Cycle" Then
oClientAction.PerformAction
End If
If oClientAction.Name = "Request & Evaluate Machine Policy" Then
oClientAction.PerformAction
End If
Next
================================================================================================================================================
 
 
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....
 
===========================================================================
 
ECHO *********** %1 copy
xcopy /y DDR.vbs \\%1\admin$\temp
ECHO *********** %1 Execute
psexec \\%1 wscript.exe \\%1\admin$\temp\DDR.vbs
 

===========================================================================

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

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

1 comment:

JC_2008 said...

How do I execute this?

""For /F %a in (list.txt) do one.bat %a""""

and how does the above command insert the lines in list.txt into the commands below in the variable %1?

ECHO *********** %1 copy
xcopy /y DDR.vbs \\%1\admin$\temp
ECHO *********** %1 Execute
psexec \\%1 wscript.exe \\%1\admin$\temp\DDR.vbs

The commands above work perfectly if I substitute the %1 in lines 2 and 4 with a single pc host name