wsman errors

This topic contains 5 replies, has 2 voices, and was last updated by Profile photo of Ondrej Zilinec Ondrej Zilinec 2 years, 1 month ago.

  • Author
    Posts
  • #19889
    Profile photo of Oliver Adams
    Oliver Adams
    Participant

    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

  • #19890
    Profile photo of Ondrej Zilinec
    Ondrej Zilinec
    Participant

    Can you share code with us? 🙂

  • #19891
    Profile photo of Oliver Adams
    Oliver Adams
    Participant

    $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

    ]

    • #19892
      Profile photo of Ondrej Zilinec
      Ondrej Zilinec
      Participant

      Do you have some [b]typos[/b] in here by accident?

      First one is on line 2. I thing it should be:
      [i]$Cred = new-object System.Management.Automation.PSCredential "USERNAME",$Pass[/i]

      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"?

  • #19893
    Profile photo of Oliver Adams
    Oliver Adams
    Participant

    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.

    • #19895
      Profile photo of Ondrej Zilinec
      Ondrej Zilinec
      Participant

      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.

You must be logged in to reply to this topic.