SOLVED

Connect -MsolService does not work with MFA

Copper Contributor

Community

 

My Global Admin account in my tenant is configured for MFA. I have installed MS Exchange Online PowerShell Module and I am able to successfully log in with MFA.

 

I need to perform an update using Set-MsolUserPrincipalName, however it complains I need to run Connect-MsolService first.

When I do this, I am presented with a basic sign-in box (not MFA) and it just does not work to log in using the same credentials I used with the inital login.

 

What am I missing here?

 

Regards,

 

14 Replies
best response confirmed by Thomas (Copper Contributor)
Solution

 i think, you are using old version Azure active directory module powershell, so you can try with new version 1.1.166.0 or 2.0

Thanks a lot for your reply.

I thought I had the latest, but I went to my Exchange Admin Center under hybrid and installed the latest. Now it seems to work fine and I am presented with the same MFA login box when I use Connect-MsolService cmdlet.

 

Regards,

Thomas

 

When I tried to run connect-msolservice, it gave me a blank screen. same with connect-azureAD.

Connect-msol error.JPG

It seems cookies are blocked on your client or some firewall things preventing you to open the window properly. Can you allow cookies and try it again?

I was able to fix it by running the below commands in PS ISE as admin:

Find-Module MSOnline

Install-Module MSOnline

Import-Module msonline
Connect-MsolService
Thanks for the reply!!!

I tried it on the server where i am still facing the issue. its still the same.

Can you try to open login.microsoftonline.com in the browser on the affected machine? It seems something like application firewall or proxy configuration doesn't allow you to open the login window.

ok. trying it..
Its giving me a blank screen in IE.
but chrome works fine.

And this is your problem ;) change Internet Explorer cookie / security settings to allow to open pop ups, etc. I don't know your current configuration but try it on an other client/server to compare these settings.

 

It must be available via Internet Explorer and if this works, the login window will work as well.

Could you find the issue and did it work?

I ran into a similar issue myself recently on a PC. For me, the issue was also an outdated MSOnline package. However, I had the original 1.0 module which came via MSI. I had to uninstall 1.0 first from Control Panel before it would let me run Install-Module -Name MSOnline

 

I documented the process here https://supertekboy.com/2018/11/07/connect-msolservice-may-fail-when-mfa-is-enabled/

I had the same problem and Gareth your article Worked 100%

 

Thanks

Ash

1 best response

Accepted Solutions
best response confirmed by Thomas (Copper Contributor)
Solution

 i think, you are using old version Azure active directory module powershell, so you can try with new version 1.1.166.0 or 2.0

View solution in original post