Patch servers with SCSM, SCCM and Orchestrator

This solutions provides a process for application owners to create a change request in SCSM which will automatically install Software Updates on all systems in a SCCM collection. The patches need to be deployed as available by the Admins. This enables app owners to follow ITIL.
2.3 Star
630 times
Add to favorites
System Center
E-mail Twitter Digg Facebook
  • Get Collection ID stuck in running state
    1 Posts | Last post May 26, 2017
    • We have implemented this solution in our environment. We seem to be having an issue where the execute program activity 'Get Collection ID' sticks in a running state and doesn't proceed to the 'Tweak output' activity.
      Its set in the command execution mode and the computer details is the scsm primary management server.
      Command is as follows:
      cmd /c | C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -nolog -outputformat "Text" -c "$CollID=@();import-module smlets;$class= Get-SCSMClass -Name System.WorkItem.ChangeRequest |where {$_.Displayname -eq 'Change Request'};$cr=get-scsmobject -class $class |where {$_.ID -eq '{CRID from "Initalize Data"'};$rclass= get-scsmrelationshipclass -name System.WorkItemAboutConfigItem;$objects=get-scsmrelationshipobject -bysource $cr |where {$_.RelationshipID -eq $};foreach ($object in $objects){$i=0;$var=0;$values=$object.targetobject.values;foreach ($value in $values){if ($value.Type |Where {$ -eq 'CollectionID'}){$var=$i;}$i++;}$CollID+=$object.Targetobject.values.value[$var]}$CollID"
      The CRID seems to pass through fine from what I can see. Does there need any config for the working folder or anything else?