Microsoft.Graph module: setup and commands
Documentation: Microsoft Learn
Connect to Microsoft Graph with explicit scopes, inspect the active context and query only the users, groups or devices your automation needs.
Getting it
Install-PSResource -Name Microsoft.Graph from the PowerShell Gallery, or install only the submodules you need such as Microsoft.Graph.Users to keep import time down.
Examples
Show reference output
Show reference output
What it is for
Use it for any cloud identity task, from user and group inventory through service principal and app registration audits. Find-MgGraphCommand is the practical entry point when you know the Graph endpoint but not the cmdlet name.
Typical tasks
- Inventory users with account state and creation date
- Find guest accounts by user type
- Audit service principals and their credentials
- List group membership including nested groups
- Export sign-in logs for a review window
- Report which users hold a given license
Check the installed version
Compare the module path and version with the session used by your scheduled task or automation account. Use it for any cloud identity task, from user and group inventory through service principal and app registration audits. Find-MgGraphCommand is the practical entry point when you know the Graph endpoint but not the cmdlet name.