Run powershell script for remoting on MID server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2024 10:45 PM
I am trying to run a powershell script on MID server for transferring a file from MID to an external server using flow and action. I am using script step to insert cmd on ecc queue for MID server and am not using the powershell step since I do not want to enter separate connection and credential details in Servicenow for MID server.
When I run the powershell script directly on MID server in an interactive session, file transfer works successfully. However, when I trigger the flow with script action, I observe the below error which states that access for PSremoting is denied.
Connecting to remote server "remote_server" failed
with the following error message : Access is denied. For more information, see the about_Remote_Troubleshooting Help topic.
Kindly help me troubleshoot the issue further.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2024 11:18 PM
Are you using Copy-Item in your PowerShell script to copy the file ?
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2024 03:48 AM
Yes Amit. I am using copy-item after pssession.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2024 04:01 AM - edited ‎01-11-2024 04:01 AM
You might be running into Multi Hop Remoting issue. Please check the below links to fix it :
https://4sysops.com/archives/solve-the-powershell-multi-hop-problem-without-using-credssp/
Thanks & Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2024 08:46 PM
thanks Amit.
However, given links suggest creating PSSessionConfiguration and CredSSP which can cause vulnerabilities. Is there any other troubleshooting that can be done from Servicenow end?