Using the latest Powershell v7.0 with Office 365 / Exchange Online MFA/2FA module?

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 3 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
ITEngineer
Posts: 216
Last visit: Thu Mar 23, 2023 5:45 pm
Has voted: 4 times

Using the latest Powershell v7.0 with Office 365 / Exchange Online MFA/2FA module?

Post by ITEngineer »

What is the latest version of full Powershell module (not the Core edition) ?
How to safely upgrade to that version.

$PSVersionTable result

Code: Select all

Name                           Value
----                           -----
PSVersion                      5.1.18362.752
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.752
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
Because when my Visual Studio code was accidentally updated itself to PS Core v6.0, my Office 365 and Azure Powershell module cannot use MFA/2FA.

Thank you in advance.
/* IT Engineer */
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Using the latest Powershell v7.0 with Office 365 / Exchange Online MFA/2FA module?

Post by jvierra »

Which PowerShell module? The AzureAD module should work with PS 7,PS 5.1. Just install the latest module. If you have already installed it then use "Update-Module AzureAD"
User avatar
mxtrinidad
Posts: 399
Last visit: Tue May 16, 2023 6:52 am

Re: Using the latest Powershell v7.0 with Office 365 / Exchange Online MFA/2FA module?

Post by mxtrinidad »

Just an FYI

If you follow PowerShell 7.0 in Github, it's been known that in order to use AzureAD module, you need to use the Import-Module with the -UseWindowsPowerShell parameter.
Then, it will work!

:)
This topic is 3 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked