Connect to Office 365 services with multifactor authentication (MFA) and PowerShell

Multifactor authentication (MFA) is an Office 365 security best practice, especially for administrator accounts. The Office 365 portal enforces MFA for accounts that have it enabled, but administrators also use PowerShell to manage Office 365.

To connect to Office 365 services with MFA and PowerShell:

For each of these connections, you are prompted with a dialog box to collect the account user name and password and then an additional dialog box for MFA information, such as a verification code. Here is an example for SharePoint Online:


To experiment with MFA in an Office 365 trial subscription, see Multi-factor authentication for your Office 365 dev/test environment.



To join the CAAB, become a member of the CAAB space in the Microsoft Tech Community and send a quick email to to introduce yourself. Please feel free to include any information about your experience in creating cloud-based solutions with Microsoft products or areas of interest. Join now and add your voice to the cloud adoption discussion that is happening across Microsoft and the industry.