1

I've got an Orchestrator runbook that is using the Query Configuration Manager activity from the Configuration Manager Integration Pack to query SCCM for all pending application requests. It appears to be working, but I can't work out how to use the results. I can select "Query Results from ", which returns the whole object, but I want to access, say, the "User" property. When I try to use the query results, I invariably get back the entire item:

"Application"="MyApp";"CI_UniqueID"="ScopeId_5A6F4DD1-9332-4D87-B040-05437E8677D7/Application_257e201b-9c34-4d1c-9de5-b84d428cfd67/2";"Comments"="User's comment during application request";"CurrentState"="1";"LastModifiedBy"="DOMAIN\username";"LastModifiedDate"="2014-08-21T14:29:05";"ModelName"="ScopeId_5A6F4DD1-9332-4D87-B040-05437E8677D7/Application_257e201b-9c34-4d1c-9de5-b84d428cfd67";"RequestGuid"="9CCDF61B-64BC-4EE9-A31C-7DA1218F7FCF";"RequestHistory"="";"User"="DOMAIN\username";"UserSid"="";

Things I've tried:

  • {Query Results from "Previous Step"}.User
  • $({Query Results from "Previous Step"}.User)
  • $(({Query Results from "Previous Step"}).User)

Does anyone know how to do this? Using SCCM 2012 and SCO 2012 R2, FWIW.

Edit: Sorry, forgot to mention that the three attempts above have resulted in (where <itemAbove> is the, well, item above, in the code block):

  • <itemAbove>.User
  • (<itemAbove>.User)
  • $((<itemAbove>).User)
DarkMoon
  • 1,039
  • 13
  • 29

2 Answers2

0

I wound up using a PowerShell script to accomplish this.

$appReqs = Get-WmiObject -ComputerName <computername> `
  -Namespace root/SMS/site_<mysite> `
  -Class SMS_UserApplicationRequest `
  -Filter "RequestGuid = '<array of GUIDs from previous activity>'"

foreach ($appReq in $appReqs) {
  $comment = $appReq.Comments
  $user = $appReq.User
  $appName = $appReq.Application
  $date = $appReq.ConvertToDateTime($appReq.LastModifiedDate)
}
DarkMoon
  • 1,039
  • 13
  • 29
0

To answer this question for others seeking, you would use the Field function to retrieve the data.

Example: [Field('John;Smith;9055552211', ';', 2)]

The above would return 'Smith'. You would insert your 'Published Data' variable in the first argument, the last argument is the column number to return.

John C
  • 99
  • 9