Reputation: 35
I keep getting this error when the VSTS Release Definition task "Run SQL Server Scripts" is executed:
[error]System.Management.Automation.Remoting.PSRemotingTransportException: Connecting to remote server [MY DATABASE SERVER IP HERE] failed with the following error message : WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By default, the WinRM firewall exception for public profiles limits access to remote computers within the same local subnet. For more information, see the about_Remote_Troubleshooting Help topic.
I have:
Ensured the remote server is accessible via WinRM in Powershell console using WinRM quickconfig, which gives me back:
Disabled the firewall on the Target server (i also tried adding firewall exception for the appropriate IP etc. too to the Windows Remote Management rule)
I must be missing some kind of config, but I don;t know what it is!
Any help much appreciated...
Upvotes: 1
Views: 1190
Reputation: 154
You can always use powershell for this something like..
$content = Get-Content -Path "testsqlFile.sql" | Out-String Invoke-Sqlcmd -ServerInstance some-ip-address -Database database-name -Username user-name-Password password -Query $content
Upvotes: 1