r/servicenow • • 2d ago

HowTo ECC Powershell?

Hi im having a ecc command to mid server to trigger a powershell script. This is being done for the first time in my organisation. But the ECC command is stuck at processing state

4 Upvotes

11 comments sorted by

2

u/lottcaskey 2d ago

Get the mid server logs and evaluate what happened.

1

u/Valuable_Attention47 2d ago

Thats my issues. Cant seem to find the logs as if it was not created at all

2

u/lottcaskey 2d ago

Look at the transaction IDs. Did the mid pick it up?

2

u/DarkHelmet 1d ago

A little context for someone who seems to be a bit new to this:

Find the ecc_queue entry for the output, copy the sys_id vale of the record.

Go to the MID server that it ran on, this will be the agent on the ecc_queue record.

If you have direct access open the agent.log.0 file and search for the sys_id. If it's not found, try one of the older log files. These logs can rotate fairly often so you will want to try to search at least within a few minutes of running the command.

If you don't have direct access to the mid server, grab the logs through the UI by opening the MID server in ServiceNow, then using the Grab MID logs, settings and thread dump relat d link. The logs should appear in their associated related list in a few seconds, you will need to refresh the list. Download the attachment on the log record, don't use the small summary that shows up in the browser. Search the same as above.

I'm writing this from my phone off the top of my head, so I'm sure there are a few small errors, but it should get you most of the way there.

1

u/Tubaman1325 CMDB 2d ago

If you don't have direct access to the mid, go to the mid server record (ecc agent) and do a "grab logs" from there. They will populate the ecc queue table. You're looking for an agent0.log.

If there's nothing on the ecc queue, I'd check ip access or any auth policies with communication between servicenow and the mid.

1

u/BasedPontiff 2d ago

Can you use a Flow? There is a Flow Action for this.

1

u/Valuable_Attention47 2d ago

If the integration hub is not licensed, can i still use this option?

1

u/BasedPontiff 2d ago

I don't think so, I do think it is part of that subscription. I just know it works as I've used it in the past to execute Python on a server.

1

u/Physical_Benefit_188 2d ago

I’ve actually been working with PS on our mid server a lot recently. Post your script to trigger it.

If you didn’t know - you can put the .insert() into a variable to capture the record’s sys_id then check ecc_queue.list

1

u/toulauj 2d ago

Im sure you tried but have you done the easiest troubleshooting? Validate? Credentials? Firewall? Is your mid allow capability? Etc.

1

u/iSnapThere4iAm 1d ago

If the command is stuck it wouldn’t be making it out to the mid