Issue running Exchange Command remotely.

This topic contains 3 replies, has 3 voices, and was last updated by Profile photo of Daniel Krebs Daniel Krebs 2 years, 4 months ago.

  • Author
    Posts
  • #17670
    Profile photo of Braven36 .
    Braven36 .
    Participant

    What might this be? The commands work find locally.

    
    
    $scriptBlock= {
    Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
    Get-ExchangeServer 
    }
    
    
    
    Invoke-Command -Computername secretcomputername  -ScriptBlock $scriptBlock -Credential $cred
    
    
    
    
    
    
    
    
    

    An Active Directory error 0x80072020 occurred while searching for domain controllers in domain super.secret.domain.com : An operations error occurred.

    + CategoryInfo : NotSpecified: (0:Int32) [Get-ExchangeServer], ADTransientException
    + FullyQualifiedErrorId : DCAA3313,Microsoft.Exchange.Management.SystemConfigurationTasks.GetExchangeServer
    + PSComputerName : secretcomputername

  • #17682
    Profile photo of Adnan Rashid
    Adnan Rashid
    Participant

    not sure what that could be however to troubleshoot it

    perhaps take out the get-exchangeserver and see if it does do the add-pssnapin and then do a get-pssnapin to check its there.. if that works then put back the get-exchange server

    perhaps its not getting the time to load the snapin before running the get-exchangeserver command?

    cheers

  • #17689
    Profile photo of Braven36 .
    Braven36 .
    Participant

    IF I enter a pssession, it does the same thing. But if I log into the server and run the command it works fine. Name Resolution work on the servers. also.

  • #17712
    Profile photo of Daniel Krebs
    Daniel Krebs
    Participant

    Hello Braven36,

    You're experiencing a double hop problem. You'll need to read up on how to configure Kerberos delegation for the computer account of the first remote server.

    http://blogs.technet.com/b/askds/archive/2008/06/13/understanding-kerberos-double-hop.aspx

    Regards,
    Daniel

You must be logged in to reply to this topic.