How to create payload in ecc queue?

Sathwik1
Tera Expert

Can someone help me to create payload in ecc queue..

I need to pass a powershell command through payload  so that command can perform some action in the midserver.

1 ACCEPTED SOLUTION

@Sathwik1 

I wrongly copied these 2 lines

try this

var value = "Get-ChildItem –Path \\'C:\\SathwikFolder\\' -Recurse | Where-Object {($_.LastWriteTime -lt (Get-Date).AddDays(-10))} | Remove-Item";
var payload = '<?xml version="1.0" encoding="UTF-8"?><parameter name="name" value="' + value + '"></parameter>';

when I used this it didn't give me xml error

see output below

XML Error.gif

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

21 REPLIES 21

Sathwik1
Tera Expert

Ankur Bawiskar
Tera Patron
Tera Patron

@Sathwik1 

what did you start with and where are you stuck?

should be simple enough

sharing links for help

Calling PowerShell script on MID server 

Execute Powershell Script from ServiceNow 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

I want pass a PowerShell command.. something like below..

**********"PowerShell -Command "Get-ChildItem –Path \"************

Command is working fine as expected, but there is only one small issue... i.e., Name length is 120.. my command crosses 150.. so instead of changing the name length, I want to pass comand through XML Payload..

but I didn't understand how to create payload.. I have gone through above links.. but didn't understand in paramerts what should I pass..

 

can you pls help me step to step on how to proceed?

 

@Sathwik1 

please share what script you are trying

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader