none
unable to connect to compliance protection RRS feed

  • Question

  • Hi Experts

    i am unable to connect to compliance protection as MFA is enabled on my account. i have used the below syntax in exchange online powershell module but it is not working.

    $UserCredential = Get-Credential
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.compliance.protection.outlook.com/powershell-liveid/ -AzureADAuthorizationEndPointUri https://login.microsoftonline.com/common



    • Edited by ItsMe-Roger Tuesday, August 27, 2019 7:49 PM c
    Tuesday, August 27, 2019 7:29 PM

All replies

  • Hi Roger, 

    If your account uses multi-factor authentication (MFA) or federated authentication, you can't use remote PowerShell to connect to the Office 365 Security & Compliance Center. Instead, you need to install the Exchange Online Remote PowerShell Module, and use the Connect-IPPSSession cmdlet to connect to Security & Compliance Center PowerShell.

    Details see:

    Connect to Office 365 Security & Compliance Center PowerShell using multi-factor authentication


    Best Regards,
    Niko Cheng


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com

    Wednesday, August 28, 2019 2:00 AM
    Moderator
  • On my exchange online powershell module i have used the below syntax. I am logged in with my laptop with username: user1@contoso.com but my privilege account to connect to exchange online powershell module is user2@contoso.com

    PS C:\Users\user1> Connect-IPPSSession -UserPrincipalName user2@contoso.com -ConnectionUri https:/
    /ps.compliance.protection.outlook.com/PowerShell-LiveID -AzureADAuthorizationEndPointUri https://login.microsoftonline.c
    om/common
    I am getting the below error

    New-ExoPSSession : User 'user1@contoso.com' returned by service does not match user 'user2@contoso.com' in the request
    AtC:\Users\user1\AppData\Local\Apps\2.0\ZBF9UYT4O.1AZ\7JIUYTERE.MN8\micr..tion_1H1H1H1H1H1I_0010.0
    000_22e56f9efbc200c6\CreateExoPSSession.ps1:301 char:30
    + ... PSSession = New-ExoPSSession -UserPrincipalName $UserPrincipalName.Va ...
    +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [New-ExoPSSession], AdalUserMismatchException
        + FullyQualifiedErrorId : Microsoft.IdentityModel.Clients.ActiveDirectory.AdalUserMismatchException,Microsoft.Exch
       ange.Management.ExoPowershellSnapin.NewExoPSSession

    Wednesday, August 28, 2019 4:29 PM
  • Hi Roger,

    Try opening the powersehll module as an administrator and connect it using User2@contoso.com, then check if any helps.


    Best Regards,
    Niko Cheng


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com

    Thursday, August 29, 2019 8:55 AM
    Moderator
  • Hi Roger,

    I'm just writing to check how's everything going? If you have any questions or needed further help on this issue, please feel free to post back. If the issue has been resolved, please mark the helpful replies as answers, this will make answer searching in the forum easier and be beneficial to other community members as well.

    Thanks for your understanding.


    Best Regards,
    Niko Cheng


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com

    Friday, September 6, 2019 1:29 AM
    Moderator
  • Hi experts i am getting the below warning when i use the syntax

    Connect-IPPSSession -UserPrincipalName user2@contoso.com

    PS C:> Connect-IPPSSession -UserPrincipalName user2@contoso.com
    WARNING: Your connection has been redirected to the following URI:
    "https://eur03c.ps.compliance.protection.outlook.com/PowerShell-LiveId BasicAuthToOAuthConversion=true;PSVersion=5.1.16
    299.1146 "
    WARNING: The names of some imported commands from the module 'tmp_quu4z3hb.tkx' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.


    Thursday, September 12, 2019 4:48 AM