Forum Discussion

Deleted's avatar
Deleted
Mar 01, 2018
Solved

Connect to Office365 via Powershell as a Delegate Access Partner with MFA enabled

Hi,

we have identities in our Partner Center Azure AD which have e.g. global admin rights for the customer tenants. In the Partner Center Azure AD we´ve enabled MFA for this accounts.

I can use the admin portal as expected with this constellation when using the URL:

https://portal.office.com/Partner/BeginClientSession.aspx?CTID=TENANDGUID&CSDEST=o365admincenter

 

When MFA is not enabled it works also fine with the PSSession Function (see https://docs.microsoft.com/en-us/office365/enterprise/powershell/connect-to-exchange-online-tenants-with-remote-windows-powershell-for-delegated): 

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell-liveid?DelegatedOrg=<customer tenant domain name>-Credential $UserCredential -Authentication Basic -AllowRedirection

 

But when I´m trying to connect via Connect-Exopsession in a similar way:

connect-exopsession -connectionuri https://ps.outlook.com/powershell-liveid?DelegatedOrg=<customer tenant domain name> 

the authentication prompt came up and authenticates me successfull, but after that i´m getting a HTML error reponse in the powershell like this:

Any thoughts what i´m doing wrong or why it doesn´t work?

 

Thank you

Jakob

  • VasilMichev's avatar
    VasilMichev
    Mar 01, 2018

    We've brought this issue several times already, but afaik it's still not supported. On the other hand, the "sister" SCC MFA module does support delegate access via the corresponding parameter:

     

     Connect-IPPSSession -DelegatedOrganization

     

    It's just another example on how the different teams at Microsoft fail to talk to each other...

    • Deleted's avatar
      Deleted

      Hi Pablo,

      thank you for your reply. I thought the cmdlet´s use the same targets in general.

      But the original question is how to connect to office 365 / Exchange Online via PS with MFA as a delegate access partner.

       

      Jakob

      • Pablo R. Ortiz's avatar
        Pablo R. Ortiz
        Steel Contributor

        I couldn't find any documentation on connecting to EXO as a delegate with MFA. I don't even know if it's possible. This is what I would try:

        1. Follow the instructions in the URL to install EXO MFA module, open it and run Connect-EXOPSSession as per the documentation. After connected run your $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell-liveid?DelegatedOrg=<customer tenant domain name>-Credential $UserCredential -Authentication Basic -AllowRedirection

Resources