Flow designer returns Status 1 for powershell script

Rohith Sureshk1
Tera Contributor

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 

13 REPLIES 13

Viraj Hudlikar
Tera Sage

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.

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. 

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?