Authentication failure with PowerShell in custom IntegrationHub activity

Nicolas17
Tera Expert

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:

find_real_file.png

 

So far, all my attempts fail with "Authentication failure with the user ... ":

find_real_file.png

 

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?

1 ACCEPTED SOLUTION

joshvanharn
Kilo Guru

Can you also post your script? There might be something with how you parse the $cred.

View solution in original post

8 REPLIES 8

alexgg57
Tera Expert

try add below input to PS step

credType = AD

then tell us how it will be going.

Like this?

find_real_file.png

 

Same result.

alexgg57
Tera Expert

What the log in MID says?

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