none
Powershell Remote Access to Exchange Server in same Domain RRS feed

  • Question

  • Hello,

    I've following problem concerning the Exchange remote Powershell: I'm trying to set up a remote Powershell connection to an exchange on-premise server. Both pcs are in the same domain, so I try this cmdlets:

    Enter-PSSession exchange01

    Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn

    #Everything works fine until here but than I'm trying to fire up a cmdlet for my exchange server

    [exchange01]: PS C:\Users\Administrator.DOMAIN\Documents> Get-Mailbox
    Active Directory operation failed on . The supplied credential for 'DOMAIN\Administrator' is invalid.
        + CategoryInfo          : NotSpecified: (:) [], ADInvalidCredentialException
        + FullyQualifiedErrorId : [Server=exchange01,RequestId=cfdb8f00-383d-48cb-ad48-5c49192443e6,TimeStamp=24.05.2019  1:51:20] [FailureCategory=Cmdlet-ADInvalidCredentialException] 3FC0C0D

    I already tried it in different scenarios, sent credentials and so on. But I come all the time to this result.

    Any ideas?

    Friday, May 24, 2019 11:52 AM

Answers

  • Hello,

    I've following problem concerning the Exchange remote Powershell: I'm trying to set up a remote Powershell connection to an exchange on-premise server. Both pcs are in the same domain, so I try this cmdlets:

    Enter-PSSession exchange01

    Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn

    #Everything works fine until here but than I'm trying to fire up a cmdlet for my exchange server

    [exchange01]: PS C:\Users\Administrator.DOMAIN\Documents> Get-Mailbox
    Active Directory operation failed on . The supplied credential for 'DOMAIN\Administrator' is invalid.
        + CategoryInfo          : NotSpecified: (:) [], ADInvalidCredentialException
        + FullyQualifiedErrorId : [Server=exchange01,RequestId=cfdb8f00-383d-48cb-ad48-5c49192443e6,TimeStamp=24.05.2019  1:51:20] [FailureCategory=Cmdlet-ADInvalidCredentialException] 3FC0C0D

    I already tried it in different scenarios, sent credentials and so on. But I come all the time to this result.

    Any ideas?

    Thats not supported. You can't use the PSSnapin.

    You have to remote to the server

    https://docs.microsoft.com/en-us/powershell/exchange/exchange-server/connect-to-exchange-servers-using-remote-powershell?view=exchange-ps

    and really, you dont need to pass cred on the same domain This will work

    $exchangeserver = <your Exch Server>
    $E2K16 = new-pssession -configurationname Microsoft.Exchange -connectionuri "http://$exchangeserver/PowerShell/" -authentication kerberos

    import-pssession $E2K16 -disablenamechecking:$True 2>&1 | out-null

    Friday, May 24, 2019 12:14 PM
    Moderator

All replies

  • You have to use credential, try this:

    $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://exchange:25443/powershell -Credential (Get-Credential -Credential user@domain) -Authentication basic -errorAction:stop
    import-pssession $session

    or this:

    $Credential = Get-Credential
    Enter-PSSession -ComputerName Exchange -Credential $Credential
    Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn

    Friday, May 24, 2019 12:11 PM
  • Hello,

    I've following problem concerning the Exchange remote Powershell: I'm trying to set up a remote Powershell connection to an exchange on-premise server. Both pcs are in the same domain, so I try this cmdlets:

    Enter-PSSession exchange01

    Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn

    #Everything works fine until here but than I'm trying to fire up a cmdlet for my exchange server

    [exchange01]: PS C:\Users\Administrator.DOMAIN\Documents> Get-Mailbox
    Active Directory operation failed on . The supplied credential for 'DOMAIN\Administrator' is invalid.
        + CategoryInfo          : NotSpecified: (:) [], ADInvalidCredentialException
        + FullyQualifiedErrorId : [Server=exchange01,RequestId=cfdb8f00-383d-48cb-ad48-5c49192443e6,TimeStamp=24.05.2019  1:51:20] [FailureCategory=Cmdlet-ADInvalidCredentialException] 3FC0C0D

    I already tried it in different scenarios, sent credentials and so on. But I come all the time to this result.

    Any ideas?

    Thats not supported. You can't use the PSSnapin.

    You have to remote to the server

    https://docs.microsoft.com/en-us/powershell/exchange/exchange-server/connect-to-exchange-servers-using-remote-powershell?view=exchange-ps

    and really, you dont need to pass cred on the same domain This will work

    $exchangeserver = <your Exch Server>
    $E2K16 = new-pssession -configurationname Microsoft.Exchange -connectionuri "http://$exchangeserver/PowerShell/" -authentication kerberos

    import-pssession $E2K16 -disablenamechecking:$True 2>&1 | out-null

    Friday, May 24, 2019 12:14 PM
    Moderator
  • Thank you so much! It works perfectly.
    Friday, May 24, 2019 12:45 PM