wsman errors

I am trying to run a command on a remote server using invoke-command. The command is Get.CSer. When I try to connect using kerberos I get the error: Active Directory error “-2147016672” occurred while searching for domain controllers in domain

Can you share code with us? :slight_smile:

$Pass = ConvertTo-SecureString -String ‘PASSWORD’ -AsPlainText -Force
$Cred = new-object System.Management.Automation.PSCredential((USERNAME’), $Pass)
Invoke-Command -ComputerName Lyncserver.domain.com -Credential $cred -ScriptBlock {

Import-Module Lync

Get-CSUser

]

Do you have some typos in here by accident?

First one is on line 2. I thing it should be:
$Cred = new-object System.Management.Automation.PSCredential “USERNAME”,$Pass

On last line there should be “}” instead of “]”.

Do you have computer in domain where you try to run script? Do you use USERNAME in form “DOMAIN\USERNAME” or just “USERNAME”?

Sorry I just copied it out and added that manually by mistake. I use full domain\username credentials just edited them out. The script works fine on two other servers. Just had the error on this one.

Try if those two good server use Kerberos and this one has problem with Kerberos. Use command “klist” to display Kerberos tickets. Use “klist purge” command to delete all Kerberos tickets.