Must-have PowerShell Modules for Azure and Microsoft 365 Administrators
Categories:
5 minute read
In this post I have summed up all modules I personally prefer to install almost every time on a clean Windows installation and I can recommend to every other Azure or Microsoft 365 administrator. It’s purpose is to have a live overview of the modules most administrators need and use often.
1: Microsoft Graph PowerShell SDK
The Microsoft Graph PowerShell SDK is basically the modern management module for Microsoft 365 and Entra ID. More and more older modules are replaced by Microsoft Graph. You can use it for users, groups, Conditional Access, devices, Intune, licensing, authentication methods and much more.
I use this module almost daily because many modern Microsoft 365 automation tasks now needs Graph.
Open Microsoft Graph in PowerShell Gallery
To install this PowerShell module on your computer, run the following command:
Install-Module Microsoft.Graph -Scope CurrentUserTo connect with this module to your Microsoft tenant, use this command:
Connect-MgGraph2: Exchange Online PowerShell
The Exchange Online module is still a must-have when managing mailboxes, mail flow, shared mailboxes and Exchange permissions. Even though a lot can be done through the portal, PowerShell stays much faster for bulk changes and reporting. Some more advanced options however require you to use PowerShell.
Open Exchange Online module in PowerShell Gallery
To install this PowerShell module on your computer, run the following command:
Install-Module ExchangeOnlineManagement -Scope CurrentUserTo connect with this module to your Microsoft tenant, use this command:
Connect-ExchangeOnline3: Azure PowerShell (Az module)
The Az module is the main PowerShell module for managing Microsoft Azure resources.It contains hundreds of commands for virtual machines, networking, storage, RBAC, Azure Virtual Desktop, backups and much more. For automation and scripting in Azure, this module is almost impossible to miss.
Open Az module in PowerShell Gallery
To install this PowerShell module on your computer, run the following command:
Install-Module Az -Scope CurrentUserTo connect with this module to your Microsoft tenant, use this command:
Connect-AzAccount4: Azure CLI
Even though this is not a PowerShell module, I still install Azure CLI on every management workstation. Some Microsoft documentation examples are written for Azure CLI and sometimes certain preview or newer features arrive there first. It is also heavily used in automation, DevOps pipelines and Terraform deployments.
To install this module on your computer, run the following command:
winget install --exact --id Microsoft.AzureCLITo connect with this module to your Microsoft tenant, use this command:
az login5: Microsoft Teams PowerShell
The Microsoft Teams module is useful for managing Teams policies, calling configurations, meeting settings and Teams automation.
I mostly use it for reporting and bulk configuration changes.
Open Microsoft Teams module in PowerShell Gallery
To install this PowerShell module on your computer, run the following command:
Install-Module MicrosoftTeams -Scope CurrentUserTo connect with this module to your Microsoft tenant, use this command:
Connect-MicrosoftTeams6: Microsoft SharePoint Online Management Shell
This module is useful for managing SharePoint Online sites and settings.
For example:
- SharePoint administration
- Site collections
- Storage limits
- External sharing settings
- OneDrive management
Open SharePoint Online module in PowerShell Gallery
To install this PowerShell module on your computer, run the following command:
Install-Module Microsoft.Online.SharePoint.PowerShell -Scope CurrentUserTo connect with this module to your Microsoft tenant, use this command:
Connect-SPOService -Url https://contoso-admin.sharepoint.com7: Maester
A great honorable mention is Maester, which is a really interesting third-party PowerShell module focused on Microsoft 365 security testing and validation. It can help checking security configurations and detecting security gaps in your tenant. I especially like this module because it makes reviewing Microsoft 365 security settings much easier and more structured. This module can be used to set up a plan for your organization to use more security options and to get a basic understanding
This is one of those tools that is really useful for MSPs and security reviews.
Open Maester in PowerShell Gallery
Install-Module Maester -Scope CurrentUserTo connect with this module to your Microsoft tenant, use this command:
Invoke-MaesterBulk installation
If you want to prepare a fresh management workstation quickly, you can use the script below to install everything directly. This installs the latest stable versions available from the PowerShell Gallery and Azure CLI through Winget.
# Install PowerShell modules
Install-Module Microsoft.Graph -Scope CurrentUser
Install-Module ExchangeOnlineManagement -Scope CurrentUser
Install-Module Az -Scope CurrentUser
Install-Module MicrosoftTeams -Scope CurrentUser
Install-Module Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser
Install-Module Maester -Scope CurrentUser
# Install Azure CLI
winget install --exact --id Microsoft.AzureCLIDepending on device, this can take a couple of minutes to complete.
Summary
These modules and tools are part of my default setup when preparing a new laptop, VM or management server. They make Azure and Microsoft 365 administration much easier and save a lot of time when automating or troubleshooting environments.
Especially Microsoft Graph, Az PowerShell and Exchange Online PowerShell are modules I use almost every day.
Thank you for reading this post and I hope it was helpful!
Sources
These sources helped me by writing and research for this post;
- https://www.powershellgallery.com/packages/Microsoft.Graph
- https://www.powershellgallery.com/packages/ExchangeOnlineManagement
- https://www.powershellgallery.com/packages/Az
- https://learn.microsoft.com/en-us/cli/azure/
- https://www.powershellgallery.com/packages/MicrosoftTeams
- https://www.powershellgallery.com/packages/microsoft.online.sharepoint.powershell
- https://www.powershellgallery.com/packages/maester
End of the page 🎉
You have reached the end of the page. You can navigate through other blog posts as well, share this post on X, LinkedIn and Reddit or return to the blog posts collection page. Thank you for visiting this post.
If you find this page and blog very useful and you want to leave a donation, you can use the button below to buy me a beer. Hosting and maintaining a website takes a lot of time and money. Thank you in advance and cheers :)
The terms and conditions apply to this post.