
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 01:54 AM
Dear community,
I'm trying to create my first custom action that would run a PowerShell command to create a new OU in Active Directory:
So far, all my attempts fail with "Authentication failure with the user ... ":
This account is domain admin and is local admin on the MID Server.
When I run manually the command on the server with the same account, it works. The OU is well created.
When using a provided Microsoft AD activity, it works perfectly fine. I don't understand why I can't just run a basic PowerShell command. Any idea?
Solved! Go to Solution.
- Labels:
-
IntegrationHub
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 07:14 AM
Can you also post your script? There might be something with how you parse the $cred.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 06:30 AM
try add below input to PS step
credType = AD
then tell us how it will be going.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 06:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 06:51 AM
What the log in MID says?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 07:00 AM
Thanks a lot for helping, alexgg57!
2021-04-07 15:57:58 (374) Worker-Expedited:IPaaSActionProbe-2b10f53edbd3ac1068bfed6b4b96197e DEBUG: Executing command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy unrestricted -noninteractive -nologo -noprofile -command "& {& 'scripts\PowerShell\PSScript.ps1' -computer 'l1vwpidccrl01.crlux.lu' -script 'C:\ServiceNow\CRLux2\agent\scripts\PowerShell\ADSpoke\CreateOU.ps1' -useCred $true -ismid $false -isDiscovery $true -debug $true -logInfo $false -skipTest $false -executeRemote $false -processTimeout 600 -copyScriptToTarget $false; exit $LASTEXITCODE}"
2021-04-07 15:57:58 (374) Worker-Expedited:IPaaSActionProbe-2b10f53edbd3ac1068bfed6b4b96197e DEBUG: With credential named : ADHUBCRLUX
2021-04-07 15:57:58 (406) Worker-Expedited:IPaaSActionProbe-2b10f53edbd3ac1068bfed6b4b96197e DEBUG: Thread name is Powershell is executing...
2021-04-07 15:58:02 (584) Worker-Expedited:IPaaSActionProbe-2b10f53edbd3ac1068bfed6b4b96197e DEBUG: The exit value from waitFor() is 1
2021-04-07 15:58:04 (647) Worker-Expedited:IPaaSActionProbe-2b10f53edbd3ac1068bfed6b4b96197e DEBUG: Execution status: failed
2021-04-07 15:58:04 (647) Worker-Expedited:IPaaSActionProbe-2b10f53edbd3ac1068bfed6b4b96197e SEVERE *** ERROR *** Authentication failure with the user svc_Snow_IntHub
2021-04-07 15:58:04 (647) Worker-Expedited:IPaaSActionProbe-2b10f53edbd3ac1068bfed6b4b96197e SEVERE *** ERROR *** Failed while executing CreateOU.ps1 (Access denied)
2021-04-07 15:58:04 (647) Worker-Expedited:IPaaSActionProbe-2b10f53edbd3ac1068bfed6b4b96197e SEVERE *** ERROR *** Authentication failure with the user svc_Snow_IntHub
2021-04-07 15:58:04 (647) Worker-Expedited:IPaaSActionProbe-2b10f53edbd3ac1068bfed6b4b96197e 2021-04-07 15:57:58 Tried Credential: name=ADHUBCRLUX, affinity: yes, status=failed, sysid=e0d3f15cdbafd0107f4aee805b9619a1, username=svc_Snow_IntHub, type=Windows, order=100