Others

Check Microsoft 365 Directory Sync Status with PowerShell

Amos GikundaAmos Gikunda Nov 20, 2026 868 views

Question details

Check directory synchronization timestamps and provisioning errors for Microsoft 365 users with PowerShell.

Check Microsoft 365 Directory Sync Status 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.
Before you start

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.

Solution 1Recommended

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.

1
Install and connect

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.

2
Check one user

Replace the address and run: Get-MgUser -UserId "user@domain.com" -Property UserPrincipalName,OnPremisesSyncEnabled,OnPremisesLastSyncDateTime,OnPremisesProvisioningErrors | Select-Object UserPrincipalName,OnPremisesSyncEnabled,OnPremisesLastSyncDateTime,OnPremisesProvisioningErrors

3
Inspect provisioning errors

To see the error details for that user, run: (Get-MgUser -UserId "user@domain.com" -Property OnPremisesProvisioningErrors).OnPremisesProvisioningErrors | Format-List *

4
Export user timestamps

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

Check user sync timestamps and errors with Microsoft Graph PowerShell
Interpret the results: A null timestamp or sync setting may indicate that the account is not currently synchronized from an on-premises directory. The CSV command exports timestamps and sync settings, not detailed provisioning errors.
Free Microsoft Office alternative

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.

Open and review exported directory sync CSV reportsCompatible with Microsoft Excel XLSX and XLS filesFamiliar spreadsheet interface for an easy transitionFree, lightweight suite for everyday office work
microsoft office alternative - wps office

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.