Step 5 is where I messed up.
https://learn.microsoft.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.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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
Step 5 is where I messed up.
https://learn.microsoft.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.
You want to use this to connect:
Connect-ExchangeOnline
Example:
Connect-ExchangeOnline -CertificateFilePath "C:\Users\johndoe\Desktop\automation-cert.pfx" -CertificatePassword (ConvertTo-SecureString -String "<My Password>" -AsPlainText -Force) -AppID "36ee4c6c-0812-40a2-b820-b22ebd02bce3" -Organization "contosoelectronics.onmicrosoft.com"
Same error.
Perhaps its a provisioning thing. I created the app today.
That may be the cause, please also ensure you have met all the prerequisites to perform the action.
For example make sure you have setup/register the app in Azure correctly.
Detailed steps and information can be seen in below link:
A first look at Certificate-Based Authentication for Exchange Online Remote PowerShell
If the response is helpful, please click "Accept Answer" and upvote it.
Make sure you have granted a qualifying Azure AD role for the application object, such as Global Admin/Exchange admin.