Exchange PowerShell MFA v2 with Certificate Failing

David Jenkins 946 Reputation points
2020-08-23T18:59:49.59+00:00

I'm trying to connect to exchange using the v2 powershell module. Logging in with regular user accounts works fine. I ensured I upgraded to the preview edition so I could use apps and certificates for powershell automation. I've got a self signed cert and imported it to the app. When I try to connect I get the following error:

Using ConnectionUri:'https://outlook.office365.com/powershell-liveid/', in the environment:'O365Default'.
New-ExoPSSession : Connecting to remote server outlook.office365.com failed with the following error message : ᨰ緱ɋ For
more information, see the about_Remote_Troubleshooting Help topic.
At C:\Program Files\WindowsPowerShell\Modules\ExchangeOnlineManagement\2.0.3\ExchangeOnlineManagement.psm1:481 char:30

  • ... PSSession = New-ExoPSSession -ExchangeEnvironmentName $ExchangeEnviro ...
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : ResourceUnavailable: (:) [New-ExoPSSession], PSRemotingTransportException
  • FullyQualifiedErrorId : System.Management.Automation.Remoting.PSRemotingDataStructureException,Microsoft.Exchang
    e.Management.ExoPowershellSnapin.NewExoPSSession
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,579 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,125 questions
0 comments No comments
{count} votes

Accepted answer
  1. David Jenkins 946 Reputation points
    2020-08-24T08:53:52.883+00:00

    Step 5 is where I messed up.
    https://video2.skills-academy.com/en-us/powershell/exchange/app-only-auth-powershell-v2?view=exchange-ps

    I guess I didn't hit the save button or something like that.

    1 person found this answer helpful.
    0 comments No comments

6 additional answers

Sort by: Most helpful
  1. David Jenkins 946 Reputation points
    2020-08-24T07:46:22.197+00:00

    Looks like I didn't fully apply the application permissions for the app to the security role. I just completed the change. I'm hoping this will resolve the issue.

    0 comments No comments

  2. David Jenkins 946 Reputation points
    2020-08-24T08:52:08.897+00:00

    Yeah that was it. It works.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.