question

jansiranikrishnan-1796 avatar image
0 Votes"
jansiranikrishnan-1796 asked AndreasBaumgarten commented

Executing Orchestrator Runbook using PowerShell

Hi Team,

I am followed the below link to call an Orchestrator Runbook via a PowerShell code by invoking a web-service call.

It is working when i used the below POST body structure.

105513-image.png

when i try to use the similar XML POST body structure, it is not working and throwing the error message "105492-image.png".. Am i missing anything in the second XML structure.

105449-image.png

Please help me in figure out the error.


msc-orchestrator
image.png (28.0 KiB)
image.png (3.6 KiB)
image.png (27.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

AndreasBaumgarten avatar image
1 Vote"
AndreasBaumgarten answered AndreasBaumgarten commented

Hi @jansiranikrishnan-1796 ,

in the second screenshot the ´<d:Parameters> .... </d:Parameters>´ section is not in the right format. It should be in the same format like the first screenshot.

you have to use the &lt; instead of < and &gt; instead of >and so on. You have to use these HTML Special entities.
That's something "special" in Orchestrator ;-)


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Andreas,

Okay Got it. Will the Orchestrator accept the JSON format? If so how should we convert this to the proper HTTP POST request in JSON format. Please share any working JSON request format.

In my case, ServiceNow would be sending me the HTTP POST request to SCSM for any Incident updates happen at their end. I have the "Initialize Data" activity to accept the request and "Run .Net Script" to update the inputs in the incident form.

It would be great if I am able to share the HTTP POST request format in easy and readable form to the ServiceNow team.

Regards,
Jansi

0 Votes 0 ·

Hi @jansiranikrishnan-1796 ,

the "working format" you can see in your first screenshot. At least you said it's working.


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

0 Votes 0 ·

Andreas,

As you mentioned in your earlier post (https://docs.microsoft.com/en-us/answers/questions/431056/executing-an-orchestrator-runbook-via-powershell.html), I checked the Orchestrator services and one of the service was not working, So After i ran the service, The XML body structure as in the first screenshot is working..

I feel it is not readable format or i think it is very difficult for ServiceNow team to understand and frame the request if there are more number of input fields.

Is there a chance that can we send the POSTbody in JSON format? If yes, please share any JSON POSTBody format.

Regards,
Jansi

0 Votes 0 ·
Show more comments