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
06-25-2024 01:45 AM
PowerShell script execution failed. Script returned status 1 using account user
can anyone help me that how to resolve this issue?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2025 03:27 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2025 03:43 AM
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)"
}
}
This worked without issues in dev but facing issues in QA. Can you please guide me what needs to be checked.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2025 04:12 AM
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.