WMI Over 1-Way Trust

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.&

June 29th, 2015 12:21pm

New-PsSession -Authentication Negotiate ...

$s=New-CImSession -Authentication Negotiate -ComputerName ...

Get-CimInstance -session $sw

The SDK classes will negotiat0e but may not authenticate if your account is not being given DCOM permissions.  You will need to eb a memebre of the remote systems admin group or alter DCOM.

I would use PsRemote to do thia as it is more relaibel and flexible.

Free Windows Admin Tool Kit Click here and download it now
June 29th, 2015 1:22pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics