wsman errors

Welcome Forums General PowerShell Q&A wsman errors

This topic contains 5 replies, has 2 voices, and was last updated by

 
Participant
4 years, 4 months ago.

  • Author
    Posts
  • #19889

    Participant
    Points: 0
    Rank: Member

    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

    Participant
    Points: 0
    Rank: Member

    Can you share code with us? 🙂

  • #19891

    Participant
    Points: 0
    Rank: Member

    $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

      Participant
      Points: 0
      Rank: Member

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

  • #19893

    Participant
    Points: 0
    Rank: Member

    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

      Participant
      Points: 0
      Rank: Member

      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.

The topic ‘wsman errors’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort