How to Connect to Microsoft 365 with PowerShell
This article has not been completed yet. However, it may already contain helpful Information and therefore it has been published at this stage
Step 1: Install the required software
These steps are required only one time on your computer. But you'll likely need to update the software periodically.
- If you're not running Windows 10, install the 64-bit version of the Microsoft Online Services Sign-in Assistant: Microsoft Online Services Sign-in Assistant for IT Professionals RTW.
choco install msoidcli -y -f
Follow these steps to install the Microsoft Azure Active Directory Module for Windows PowerShell:
- Open an elevated Windows PowerShell command prompt (run Windows PowerShell as an administrator).
- Run the Install-Module MSOnline command.
Install-Module MSOnline
- If you're prompted to install the NuGet provider, type Y and press Enter.
- If you're prompted to install the module from PSGallery, type Y and press Enter.
Connect-MsolService
Get-MsolUser