Flow designer returns Status 1 for powershell script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2025 11:19 PM - edited 08-04-2025 11:20 PM
Hi ,
When trying to execute a OOB flow action - Does Group exists? (from adv2 spoke), we are getting following in flow logs:
1. PowerShell Script execution failed. Script returned status 1 using account <Service-account name>.
2. Failed while executing ActionDoesGroupExists_AD_v2.ps1 (Access denied)
3. IPaasActionProbe | PowerShell Script execution failed. Script returned status 1 using account <Service-account name>.
Points to be noted:
1. Test credentials button on flow is returning no error and is successfully validating.
2. Same script with same creds when executing directly in Mid Server is working fine.
Need help on how to resolve this issue. Thanks
Regards,
Rohith.S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2025 03:28 AM
Hello @Rohith Sureshk1
Even though the credentials and script are fine, when Flow Designer runs the script, it uses a different method that may block access due to permissions or security settings.
Give proper permissions to the service account it should be allowed to read group info and run scripts remotely.
Check MID Server settings make sure it allows PowerShell scripts and is connected to the right domain.
Enable “Log on as batch job” for the service account on the MID Server this is often missed and causes issues.
Try a simple PowerShell script in Flow Designer this helps confirm if the issue is with the action or the setup.
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
08-05-2025 10:49 PM
Hi @Viraj Hudlikar ,
Thankyou. Regarding your last point, we even tried to run a simple "Write-Host" command , even that returned the error.
We are trying for "log on as batch job" permissions for the service account. Will get back to you once that is established.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 07:59 AM
hi @Viraj Hudlikar ,
I created a new copy from the oob "Does user exists" action from ad v2 spoke and When I remove the credType input variable with value as AD from powershell script and run it, it is working without any issues. Any idea on why it is happening?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2025 08:38 PM - edited 08-07-2025 08:39 PM
It's not a good practice to remove the credType variable. PFB
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0995390
Prod doc: https://www.servicenow.com/docs/bundle/zurich-integrate-applications/page/product/orchestration/refe...