- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2020 12:18 AM
Hi,
I am trying to run a PowerShell script remotely from the MID server to our AD server. but it is failing with the following error.
Mid Server IP: 10.10.10.11
AD Server IP: 10.10.10.10
"errormessages": "Connecting to remote server 10.10.10.10 failed with the following error message: The WinRM client cannot process the request. Default authentication may be used with an IP address under the following conditions: the transport is HTTPS or the destination is in the TrustedHosts list, and explicit credentials are provided. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. For more information on how to set TrustedHosts run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.\nHRESULT: [-2144108101]\n\nStack Trace:\n",
But when I am trying to run the PowerShell script directly from the MID Server to the AD server remotely it works fine for me.
What could be the potential reason?
Solved! Go to Solution.
- Labels:
-
Orchestration (ITOM)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 05:00 AM
Hi,
Despite of all the desired configuration for WinRM, I was still having the issue.
I thought of checking the MID server service properties, at the first glanc I could see that service was runing under local system account, I was sure it should be runing thorugh Domain account.
I changes the Log on as to domain/userid and took MID server service restart and WinRM service restart.
Bingo.. it resolved my issue.
Thank You,
Ramesh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2020 01:13 AM
Hi,
True. YOu need to add the AD server as trusted server on MID
https://hi.service-now.com/kb_view.do?sysparm_article=KB0687786
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2020 01:39 AM
Hi Ashutosh
In MID server I have configured *(wildcard) into the trusted host and also I have enabled "Allow remote server management through WinRM" and added *(wildcard) into the trusted host.
AD server also I have added *(wildcard) into the trusted host because when I add the MID server IP very specifically, it doesn't allow me to run the script remotely from MID server directly.
Thank You,
Ramesh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-25-2020 10:02 AM
HI,
What rights this User has when you try to do this?
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-26-2020 05:59 AM
Hi,
The user I am using is Domain Admin user.
From the MID server New-PSSession –ComputerName <AD Server> is working properly with out password. and I am able to run any query with that session.
But from Servicenow when I try to run a custom activity it fails, Error has changed now though.
"errorMessages": "Connecting to remote server <AD Server> failed with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.\nHRESULT: [5]\n\nStack Trace:\n",