Error: PowerShell script execution failed. Script returned status 1 using account user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2025 11:18 PM
Hi,
We are getting below error while executing flow
Error: PowerShell script execution failed. Script returned status 1 using account user
Please advise why we are suddenly started getting this error and what should we do to resolve it
Thanks in Advance
Anamika
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2025 11:34 PM - edited 07-27-2025 11:38 PM
Hello @Anamika Thakur
Checklist to fix the “status 1” PowerShell error in your flow:
Verify the ServiceNow credential • Account isn’t locked/expired and password matches your Credentials record.
Test MID Server -> target connectivity • Run Test-NetConnection -ComputerName <Target> -Port 5985 on the MID/Orchestration host
Check WinRM & Execution Policy • Ensure WinRM is enabled and allowed through firewall • On the target, set ExecutionPolicy = RemoteSigned
Run the script manually • RDP using the same service account and invoke the exact PS script—note any detailed error
Review logs for clues • <mid>/logs/mid.log or <inst>/logs/orchestration.log • Windows Event Viewer → Application/System
Also, do check this KB link https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1757729
If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.
Thanks & Regards
Viraj Hudlikar.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2025 11:36 PM
Try putting
exit 0
at then end of the script to verify if the error appears or not.
As suggested in below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2025 11:40 PM - edited 07-27-2025 11:41 PM
Hi @Anamika Thakur
Please check if your service account has administrative access to the host machine.
Also, verify whether any firewall is blocking the required port. If you're integrating ServiceNow with Active Directory or Exchange applications, try running the relevant cmdlets manually using the service account credentials.
Additionally, if you're using a certificate for authentication, ensure that the service account has access to the certificate.
Regards,
Siva