I use the following in PowerShell script used to set SQL instance network and port configuration.
$wmi =new-object('Microsoft.SqlServer.Management.Smo.Wmi.ManagedComputer') $cn
I run the script from my desktop in domain A using a domain A account. It runs fine against domain A servers. However, it fails when I use it remotely to manage a server in domain B. Domain B trusts domain A. This is the error in PowerShell.
The following exception occurred while trying to enumerate the collection: "SQL Server WMI provider is not available on servername.domainB.".
We did some added work to get Winrm to work. There is still a Kerberos error using the default.
Winrm id -r:servername.domainB
WSManFault
Message = WinRM cannot process the request. The following error occurred while using Kerberos authentication: Cannot find the computer servername.domainB. Verify that the computer exists on the network and that the name provided is spelled
correctly.
However, if we use negotiate, it works.
Winrm id -r:server.domainB-a:Negotiate
Is there a way to force powershell to use negotiate rather than Kerberos? I don't want to include credentials by explicitly including the username and password in script.
Thanks.&