October 31, 2022 at 11:20 am
I have a script which is used to connect to a remote SQL Server. It works well when in local Windows environment.
However, when I run it use winrm on another server, this exception happens:
November 1, 2022 at 12:10 pm
Thanks for posting your issue and hopefully someone will answer soon.
This is an automated bump to increase visibility of your question.
November 4, 2022 at 5:57 am
I have never used WinRm so can only give some general troubleshooting advice.
The first step is to isolate the failure, and thr first step in that is to verify you can connect to the remote server ok. The account used will need Windows logon as batch job rights on the target server. Get your script to only do a DOS command such as DIR and verify you are getting results from the remote machine.
Next try to connect to SQL and do a simple command such as Select @@servername. You will need to have Kerberos set up to do this. You will need SPNs for both servers, the target SQL service, and the source service if relevant. Give the account(s) running the script permission to use the SPNs. The account will also need login rights within SQL.
When you can do a remote connection to SQL then you can try doing the commands you really want to run. You will need to give relevant permissions within SQL to get to the tables etc you want to use.
Original author: https://github.com/SQL-FineBuild/Common/wiki/ 1-click install and best practice configuration of SQL Server 2019, 2017 2016, 2014, 2012, 2008 R2, 2008 and 2005.
When I give food to the poor they call me a saint. When I ask why they are poor they call me a communist - Archbishop Hélder Câmara
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply