Skip to main content
Horton Scientific

Microsoft migration script

Microsoft 365 Guest User Report

```powershell

Microsoft 365 Guest User Report

Use at your own risk. Test in a non-production environment first.

Connect-MgGraph -Scopes "User.Read.All","Directory.Read.All"
Get-MgUser -Filter "userType eq 'Guest'" -All |
  Select-Object DisplayName, UserPrincipalName, AccountEnabled, CreatedDateTime |
  Export-Csv .\m365-guest-users.csv -NoTypeInformation

Review guests before tenant-to-tenant, SharePoint, Teams, and external sharing migrations.

Let’s move your business forward

What can we help
you do next?