Microsoft 365 Error Codes

Fix PowerShell MFA Script Errors During Microsoft 365 Sign-In

Jason MillerJason Miller Nov 2, 2026 869 views

Question details

Users experience script errors or blank authentication windows when connecting to Microsoft 365 or OneDrive using PowerShell commands with MFA.

How to Fix PowerShell MFA Script Errors During Microsoft 365 Sign-In
Product
Microsoft 365, PowerShell, OneDrive
Device & OS
not provided
Scenario
Attempting to authenticate to Microsoft 365 services via PowerShell (e.g., Connect-MsolService) or logging into OneDrive.
Observed behavior
An authentication window appears displaying 'object doesn't support the includes property or method' or goes entirely blank after the user selects Yes.
Before you start

Ensure you have administrator access to the machine experiencing the issue and verify your system has the latest Windows updates installed, as this updates the core WebView components used for modern authentication.

Solution 1Recommended

Update PowerShell Modules and Use Current Connection Methods

Microsoft continuously updates authentication flows. Using deprecated modules like MSOnline can trigger script errors. Transitioning to modern modules resolves most MFA issues.

Legacy PowerShell modules often rely on outdated Internet Explorer rendering engines to display the Microsoft 365 login screen. By updating to the latest Exchange Online Management module, you force PowerShell to use modern, compatible authentication windows.

1
Open PowerShell

Right-click the Start button and select 'Windows PowerShell (Admin)' or 'Terminal (Admin)' to run the console with elevated privileges.

2
Install the modern module

Type 'Install-Module -Name ExchangeOnlineManagement -Force' and press Enter to download the latest Microsoft 365 management components.

3
Connect using the new command

Instead of using legacy commands like Connect-MsolService, type 'Connect-ExchangeOnline' and press Enter.

4
Complete MFA sign-in

When the modern Microsoft 365 authentication prompt appears, enter your credentials and approve the MFA request as usual.

Update PowerShell Modules and Use Current Connection Methods
Modern Authentication: Using Connect-ExchangeOnline fully supports modern web authentication methods, eliminating the 'includes property' script error.
Free Microsoft Office alternative

Switch to WPS Office for a Hassle-Free Productivity Experience

If complex PowerShell administration, Microsoft 365 authentication errors, or OneDrive sync issues are slowing down your productivity, consider WPS Office. It provides a lightweight, offline-capable, and completely free alternative that does not rely on complicated MFA scripts for basic document editing.

  1. 1. Download the installer: Visit the official WPS Office website and download the free installation package.
  2. 2. Install WPS Office: Run the installer and follow the simple on-screen instructions to set up the software on your computer.
  3. 3. Open your files: Double-click your existing Microsoft Office documents to open them instantly in WPS Office without needing complex authentications.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).No mandatory cloud authentication or PowerShell management required for local document editing.Lightweight installation with a familiar, easy-to-use tabbed interface.Built-in PDF editing tools at no extra cost.Seamless migration process with no steep learning curve.
QA img-9

Frequently Asked Questions

Why does PowerShell show 'object doesn't support the includes property'?

This error typically occurs when the authentication window relies on an outdated rendering engine (like legacy Internet Explorer components) to process modern JavaScript used on Microsoft's MFA pages. Transitioning to modern PowerShell modules or updating WebView2 fixes this.

Why does my Microsoft 365 authentication window go blank?

A blank window after clicking 'Yes' often means the login script crashed or the network connection to the authentication server was interrupted. Ensuring your PowerShell modules are updated to the modern Connect-ExchangeOnline method generally prevents this.

Can a VPN cause PowerShell MFA script errors?

While not the primary cause of the 'includes' script error, VPNs can sometimes block or intercept the specific Microsoft authentication URLs needed for the modern popup, resulting in a blank screen. Disconnecting the VPN temporarily can help rule this out.

How do I fix the same script error happening in OneDrive?

Since OneDrive shares the same underlying authentication components as Microsoft 365, updating Microsoft Edge WebView2 Runtime and ensuring your Windows OS is fully updated will typically resolve the login errors for both PowerShell and OneDrive.