Skip to main content

Get-EntraConnectSyncHealth

SYNOPSIS

Checks the health of Microsoft Entra Connect Sync on the sync server: service, scheduler, last runs, objects in error, pending exports and event log.

SYNTAX

DESCRIPTION

Runs a set of local checks on the Entra Connect Sync server and returns one row per check, with a status (OK, Info, Warning or Error), the observed value and a detail. Nothing is read from Microsoft Entra ID and no credential is asked: every check uses the local ADSync cmdlets, csexport.exe and the local event log. Checks:
  • Service: ADSync service state, Entra Connect version, auto-upgrade state.
  • Scheduler: sync cycle enabled, staging mode, maintenance, cycle in progress, next cycle overdue.
  • Run: result of the last run of each run profile per connector (Delta Import, Delta Synchronization, Export…) and age of the last run of each connector. A failing import (connector unreachable, expired service account password) shows up here: it is a run result, not an object error.
  • Objects: number of objects in import/synchronization error and in export error per connector, with the most frequent error types. Get-EntraConnectSyncObjectReport -ErrorsOnly lists them one by one.
  • Pending export: number of objects waiting to be exported per connector.
  • Event log: errors of the ADSync and Directory Synchronization sources.
With -LastRun, the function returns the run history instead: for each connector, the last run of each run profile, as shown in the Operations tab of the Synchronization Service Manager, with its counters. Must be run on the Entra Connect Sync server (ADSync module) with a member of the ADSyncAdmins group.

EXAMPLES

EXAMPLE 1

Runs every check on all connectors.

EXAMPLE 2

Shows only the checks that need attention.

EXAMPLE 3

Shows the last run of each run profile on every connector.

EXAMPLE 4

Exports the health checks to an Excel file.

PARAMETERS

-ConnectorName

Name of one or more connectors to check. By default, all connectors.

-EventLogHours

Number of hours of event log read for the event log check. Default 24.

-ExportToExcel

Exports the result to an Excel file in the user profile instead of returning it.

-LastRun

Returns the last run of each run profile per connector, with its result, duration and counters, instead of the health checks.

-MaxRunAgeHours

A connector whose last run is older than this number of hours is reported as Warning. Default 3.

-PendingExportThreshold

A connector with at least this number of pending exports is reported as Warning. Default 500.

-RunHistoryCount

Number of recent runs read per connector to find the last run of each profile. Default 50.

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

Requires the ADSync module, installed with Microsoft Entra Connect Sync.