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

snow34
Tera Contributor

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

 

can anyone help me that how to resolve this issue?

 

 

12 REPLIES 12

Hi @Shidhi 

Yes, I've fixed this issue by using custom PowerShell scripts.

1. Before implementing this, we need to consider a couple of things:

  • Your MID server must be installed in the same domain as the Exchange server.
  • The out-of-the-box (OOB) spoke won't work if you haven't installed your MID server on the same host as the Exchange server. (Based on my experience)

2. After setting up your MID server, you need to have a standard service account with admin access to both the MID server host and the Exchange server host.
3. In the exchange connection record, make sure to use the IP address of your mid server host in the Host field.

4. Use custom powershell script instead of using OOB scripts.
Sample to create new session:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri <YOUR SERVER NAME> -Authentication Kerberos -Credential $cred

 

After making the above changes, my flow started working. I'm not sure where you're stuck. Let me know if you need any help with any of the particular steps.

Regards,
Siva

Shidhi
Tera Contributor

Hi @J Siva ,

To give you more context, in a flow designer AD spoke is being used and in this, for both Look Up Group(OOB) and Create AD Group(custom) actions I'm getting the below error and also attaching screenshot.

{
    "Action Status": {
        "code": 1,
        "message": "Error:  PowerShell script execution failed. Script returned status 1 using account user ntsnowaddevd. (Process Automation.2e3987be3b725618d894675aa5e45a1b; line 30)"
    }
}

 

Shidhi_0-1743504135346.png
This worked without issues in dev but facing issues in QA. Can you please guide me what needs to be checked.

Thank you!

Oh ok.. you are facing this issue in ADV2 spoke.
Have you tried to run the cmdlets manually from your QA mid server?
If not try that. Based on the result we can proceed further.

1. Login to the QA midserver

2. Open Windows Powershell -> Run as Admin

3. Use the below cmdlet

# Prompt for credentials.  
# Use service account credential
$credentials = Get-Credential

# Use the credentials to get group details
Get-ADGroup -Identity "GroupName" -Credential $credentials

If you get an expected output, then the issue is with mid server access.