#ISE+MFAPowerShell
Explore tagged Tumblr posts
o365inside-blog · 6 years ago
Text
How to Connect MFA PowerShell in PowerShell ISE?
Tumblr media
If you are looking to connect MFA PowerShell in PowerShell ISE then this is the perfect article for you.  Scroll down to the 3 methods of connecting an MFA enabled account to Exchange Online PowerShell (Office 365), if you are aware of MFA accounts and connecting to PowerShell. Multi-factor authentication (MFA) is a method of authentication that requires the use of more than one verification method and adds a second layer of security to user sign-ins and transactions. Office 365 uses multi-factor authentication to help provide the extra security and is managed from the Office 365 admin center. Reference: Plan for multi-factor authentication for Office 365 Deployments  MFA is enabled per user. This means that if a user has MFA-enabled, they won’t be able to use a non-browser client, such as Outlook 2013 with Office 365, until they create an app password. An app password is a password that is created within the Azure portal and that allows the user to bypass MFA and continue to use their application. Reference: Set up multi-factor authentication for Office 365 users If MFA (Multi Factor Authentication) is enabled on an account, you will not be able to connect to Office 365 using regular PowerShell. You would need to download the MFA module and then connect to Office 365 using that PowerShell Module. To find out how to connect PowerShell to Office 365 if MFA is enabled feel free to read this article: Connect to Exchange Online PowerShell using multi-factor authentication
Tumblr media
Hopefully by now you know how to connect PowerShell to Office 365, if MFA is enabled on the account. you would know by now that every time you must connect you would need to load the Microsoft Exchange Online PowerShell Module. I work on scripts so the tool that prefer to use is PowerShell ISE. This helps me write code and test it in one application. Since the Microsoft Exchange Online PowerShell Module is on my system all I must do is load the module in PowerShell ISE to connect using this application. The module is in the following path. C:UsersClint.OliveiraAppDataLocalApps2.0
Tumblr media
MFA PowerShell Module for Exchange To connect to the MFA PowerShell module for Exchange you can the run the following syntax: Import-Module $((Get-ChildItem -Path $($env:LOCALAPPDATA+"Apps2.0") -Filter Microsoft.Exchange.Management.ExoPowershellModule.dll -Recurse ).FullName|?{$_ -notmatch "_none_"}|select -First 1) $Session=New-ExoPSSession Import-PSSession $Session -Verbose -AllowClobber Or $CreateEXOPSSession = (Get-ChildItem -Path $env:userprofile -Filter CreateExoPSSession.ps1 -Recurse -ErrorAction SilentlyContinue -Force | Select -Last 1).DirectoryName . "$CreateEXOPSSessionCreateExoPSSession.ps1"
Tumblr media
And then run the following to connect: Connect-EXOPSSession -UserPrincipalName [email protected] Alternatively, you can Change Directory to the path: CD (Get-ChildItem -Path $env:userprofile -Filter CreateExoPSSession.ps1 -Recurse -ErrorAction SilentlyContinue -Force | Select -Last 1).DirectoryName And then run .CreateExoPSSession.ps1 Hope you like the 3 methods of connecting to an MFA enabled account to Exchange Online PowerShell (Office 365) Read the full article
0 notes