Error: PowerShell script execution failed. Script returned status 1 using account user

Anamika Thakur
Tera Contributor

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

3 REPLIES 3

Viraj Hudlikar
Tera Sage

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.

Ct111
Tera Sage

Try putting 

exit 0

 

at then end of the script to verify if the error appears or not.

 

As suggested in below 

LINK

J Siva
Tera Sage

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