SOLVED
Home

Connect to Exchange Online PowerShell using MFA

%3CLINGO-SUB%20id%3D%22lingo-sub-63697%22%20slang%3D%22en-US%22%3EConnect%20to%20Exchange%20Online%20PowerShell%20using%20MFA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-63697%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20trying%20to%20follow%20the%20instructions%20on%20this%20page%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Flibrary%2Fmt775114(v%3Dexchg.160).aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Flibrary%2Fmt775114(v%3Dexchg.160).aspx%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewhich%20all%20seem%20pretty%20easy%20to%20follow.%20I'm%20on%20a%20brand%20new%20install%20of%20Windows%2010%20Pro%2C%20and%20when%20I%20try%20to%20run%20the%20file%20I%20download%20from%20Exchange%20Admin%20I%20get%20the%20error%20in%20the%20image%20attached.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20tried%20this%20on%20a%20few%20Win%2010%20Pro%20PC's%2C%20some%20brand%20new%20some%20a%20few%20months%20old%2C%20I%20get%20the%20same%20issue.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat's%20the%20correct%20way%20to%20overcome%20this%20so%20I%20can%20install%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20the%20error%20that's%20in%20the%20log%20file%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EERROR%20SUMMARY%3CBR%20%2F%3EBelow%20is%20a%20summary%20of%20the%20errors%2C%20details%20of%20these%20errors%20are%20listed%20later%20in%20the%20log.%3CBR%20%2F%3E*%20Activation%20of%20E%3A%5CMicrosoft.Online.CSE.PSModule.Client.application%20resulted%20in%20exception.%20Following%20failure%20messages%20were%20detected%3A%3CBR%20%2F%3E%2B%20Deployment%20and%20application%20do%20not%20have%20matching%20security%20zones.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-63697%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%20Online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHybrid%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-386575%22%20slang%3D%22en-US%22%3ERe%3A%20Connect%20to%20Exchange%20Online%20PowerShell%20using%20MFA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-386575%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3B.%20You%20saved%20the%20day.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-332812%22%20slang%3D%22en-US%22%3ERe%3A%20Connect%20to%20Exchange%20Online%20PowerShell%20using%20MFA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-332812%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20problem%20is%20in%20the%20first%20step%2C%20download%20and%20install.%20Indeed%20*only*%20possible%20using%20IE.%3C%2FP%3E%3CP%3ESigh...%20Thanks%20for%20your%20answer%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-319961%22%20slang%3D%22en-US%22%3ERe%3A%20Connect%20to%20Exchange%20Online%20PowerShell%20using%20MFA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-319961%22%20slang%3D%22en-US%22%3E%3CP%3ETo%20use%20MFA%20PowerShell%20in%20ISE%20you%20could%20try%20the%20following.%26nbsp%3B%3C%2FP%3E%3CP%3E-%20download%20and%20install%20the%20MFA%20PowerShell%20from%20the%20Exchange%20Online%20Admin%20Center%20(hybrid%20tab)%3C%2FP%3E%3CP%3E-%20then%20run%20the%20following%20in%20ISE%20whenever%20you%20connect%26nbsp%3B%3C%2FP%3E%3CP%3E%24CreateEXOPSSession%20%3D%20(Get-ChildItem%20-Path%20%24env%3Auserprofile%20-Filter%20CreateExoPSSession.ps1%20-Recurse%20-ErrorAction%20SilentlyContinue%20-Force%20%7C%20Select%20-Last%201).DirectoryName%3C%2FP%3E%3CP%3E.%20%22%24CreateEXOPSSession%5CCreateExoPSSession.ps1%22%3C%2FP%3E%3CP%3E-%20this%20will%20replicate%20whatever%20happens%20in%20the%20MFA%20PowerShell%20in%20ISE%26nbsp%3B%3C%2FP%3E%3CP%3E-%20Connect%20via%3A%26nbsp%3B%3C%2FP%3E%3CP%3EConnect-EXOPSSession%20-UserPrincipalName%20user%40domain.com%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-174551%22%20slang%3D%22en-US%22%3ERe%3A%20Connect%20to%20Exchange%20Online%20PowerShell%20using%20MFA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-174551%22%20slang%3D%22en-US%22%3Eomg!%20I%20was%20strugling%20with%20exatly%20the%20same%20thing%20today..%20strange%20that%20it%20does%20not%20work%20with%20other%20browsers.%3CBR%20%2F%3E%3CBR%20%2F%3EAnyhow!%20i%20got%20the%20module%20now%20and%20im%20happy%20%3A)%3C%2Fimg%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-63714%22%20slang%3D%22en-US%22%3ERe%3A%20Connect%20to%20Exchange%20Online%20PowerShell%20using%20MFA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-63714%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20that%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F58%22%20target%3D%22_blank%22%3E%40Vasil%20Michev%3C%2FA%3E.%20I%20read%20the%20instructions%20very%20cleary%20and%20at%20no%20stage%20did%20they%20stipulate%20that%20it%20had%20to%20be%20downloaded%20%2F%20run%20via%20IE.%20As%20soon%20as%20I%20did%20that%20it%20worked%20perfectly%2C%20and%20I%20was%20able%20to%20login%20with%20my%20MFA%20enabled%20account.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20assume%20this%20is%20the%20only%20PowerShell%20app%20I%20can%20use%20for%20this%20purpose%20and%20I%20can't%20now%20use%20my%20other%20PowerShell%20ISE%20for%20MFA%20also%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-63711%22%20slang%3D%22en-US%22%3ERe%3A%20Connect%20to%20Exchange%20Online%20PowerShell%20using%20MFA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-63711%22%20slang%3D%22en-US%22%3E%3CP%3EThat's%20the%20joy%20of%20running%20those%20click-once%20apps...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETry%20re-donwloading%2Finstalling%20it%20via%20IE%2C%20see%20if%20it%20makes%20a%20difference.%20If%20it%20still%20doesnt%20work%2C%20you%20probably%20have%20some%20restrictions%20set%20on%20the%20IE%20zones%20that%20prevents%20the%20app%20from%20running.%20Running%20.Net%20code%20needs%20to%20be%20enabled%20for%20example.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-482393%22%20slang%3D%22en-US%22%3ERe%3A%20Connect%20to%20Exchange%20Online%20PowerShell%20using%20MFA%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-482393%22%20slang%3D%22en-US%22%3E%3CP%3EYes%20%2Cright.%3C%2FP%3E%3CP%3EEven%20if%20I%20download%20file%20from%20chrome%2C%20it%20cannot%20work%20then%20it%20shows%20error%20like%20below%2C%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110210i420B7C2FBCBC5314%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22Message.png%22%20title%3D%22Message.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EBut%20when%20I%20download%20it%20from%20internet%20explorer%20%2C%20it%20can%20show%20message%20then%20you%20click%20install%20button.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110211iFE40D78B71B13099%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20alt%3D%22Message2.png%22%20title%3D%22Message2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThen%20you%20can%20see%20it%20like%20this.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F110212iF4A137FDFB37975A%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20alt%3D%22messages3.png%22%20title%3D%22messages3.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Frequent Contributor

Hi,

 

I'm trying to follow the instructions on this page: https://technet.microsoft.com/en-us/library/mt775114(v=exchg.160).aspx

 

which all seem pretty easy to follow. I'm on a brand new install of Windows 10 Pro, and when I try to run the file I download from Exchange Admin I get the error in the image attached.

 

I've tried this on a few Win 10 Pro PC's, some brand new some a few months old, I get the same issue.

 

What's the correct way to overcome this so I can install?

 

This is the error that's in the log file:

 

ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of E:\Microsoft.Online.CSE.PSModule.Client.application resulted in exception. Following failure messages were detected:
+ Deployment and application do not have matching security zones.

7 Replies
Solution

That's the joy of running those click-once apps...

 

Try re-donwloading/installing it via IE, see if it makes a difference. If it still doesnt work, you probably have some restrictions set on the IE zones that prevents the app from running. Running .Net code needs to be enabled for example.

Thanks for that @Vasil Michev. I read the instructions very cleary and at no stage did they stipulate that it had to be downloaded / run via IE. As soon as I did that it worked perfectly, and I was able to login with my MFA enabled account.

 

I assume this is the only PowerShell app I can use for this purpose and I can't now use my other PowerShell ISE for MFA also?

omg! I was strugling with exatly the same thing today.. strange that it does not work with other browsers.

Anyhow! i got the module now and im happy :)

To use MFA PowerShell in ISE you could try the following. 

- download and install the MFA PowerShell from the Exchange Online Admin Center (hybrid tab)

- then run the following in ISE whenever you connect 

$CreateEXOPSSession = (Get-ChildItem -Path $env:userprofile -Filter CreateExoPSSession.ps1 -Recurse -ErrorAction SilentlyContinue -Force | Select -Last 1).DirectoryName

. "$CreateEXOPSSession\CreateExoPSSession.ps1"

- this will replicate whatever happens in the MFA PowerShell in ISE 

- Connect via: 

Connect-EXOPSSession -UserPrincipalName user@domain.com

The problem is in the first step, download and install. Indeed *only* possible using IE.

Sigh... Thanks for your answer @Vasil Michev 

Thanks @Vasil Michev . You saved the day.

Yes ,right.

Even if I download file from chrome, it cannot work then it shows error like below, Message.png

But when I download it from internet explorer , it can show message then you click install button.Message2.png

Then you can see it like this.

messages3.png

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
30 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
9 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies