Check Microsoft 365 Directory Sync Status with PowerShell
Question details
Check directory synchronization timestamps and provisioning errors for Microsoft 365 users with PowerShell.

- Product
- Microsoft 365 and Microsoft Entra Connect
- Device & OS
- not provided
- Scenario
- An administrator wants to inspect user and tenant synchronization information and export user results.
- Observed behavior
- The goal is to view the last synchronization time and errors without assuming that user-level cmdlets provide every tenant-level client detail.
Use an account authorized to read users and organization information in Microsoft Entra ID. Install the Microsoft Graph PowerShell SDK if needed, and check that your organization permits the required consent.
Check user sync timestamps and errors with Microsoft Graph PowerShell
Use Microsoft Graph to inspect one user or export synchronization information for all users.
The older MSOnline module and Get-MsolUser cmdlet have been retired. Microsoft Graph PowerShell is the current approach.
A user's last sync timestamp alone does not confirm that the entire synchronization service is healthy.
In PowerShell, run Install-Module Microsoft.Graph -Scope CurrentUser if the SDK is not installed. Then run Connect-MgGraph -Scopes "User.Read.All" and complete the sign-in and consent prompts.
Replace the address and run: Get-MgUser -UserId "user@domain.com" -Property UserPrincipalName,OnPremisesSyncEnabled,OnPremisesLastSyncDateTime,OnPremisesProvisioningErrors | Select-Object UserPrincipalName,OnPremisesSyncEnabled,OnPremisesLastSyncDateTime,OnPremisesProvisioningErrors
To see the error details for that user, run: (Get-MgUser -UserId "user@domain.com" -Property OnPremisesProvisioningErrors).OnPremisesProvisioningErrors | Format-List *
Choose an existing output folder and run: Get-MgUser -All -Property UserPrincipalName,OnPremisesSyncEnabled,OnPremisesLastSyncDateTime | Select-Object UserPrincipalName,OnPremisesSyncEnabled,OnPremisesLastSyncDateTime | Export-Csv -Path "C:\Temp\SyncStatus.csv" -NoTypeInformation

Review tenant sync status and the Entra Connect scheduler
Use tenant-level information and the sync server to investigate overall synchronization and client details.
Review exported sync reports in WPS Spreadsheets
WPS Office is a free, lightweight Office alternative with a familiar interface. Open a directory sync CSV in WPS Spreadsheets to review the report, or work with Microsoft Office files when migrating your documents.

Frequently Asked Questions
Can I still use Get-MsolUser to check sync status?
The MSOnline module has been retired. Use Get-MgUser with the OnPremisesLastSyncDateTime and OnPremisesProvisioningErrors properties instead.
How do I check sync information for the whole tenant?
Connect with the Organization.Read.All scope, then use Get-MgOrganization with the OnPremisesSyncEnabled and OnPremisesLastSyncDateTime properties.
Why is a user's last sync time blank?
The account may not be synchronized from an on-premises directory. Check OnPremisesSyncEnabled alongside OnPremisesLastSyncDateTime and review the account's source in Microsoft Entra ID.
Where can I see synchronization errors for a user?
Run Get-MgUser for the user's principal name with the OnPremisesProvisioningErrors property, then pipe that property's contents to Format-List * to inspect the details.




