Using Azure Automation to Monitor Entra AD Sync for when it doesn't sync in the last 2 hours

Mark Brossman 0 Reputation points
2025-03-05T19:37:48.4466667+00:00

Using Azure Automation to Monitor Entra AD Sync for when it doesn't sync in the last 2 hours and connecting via MS.Graph

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,609 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andy David - MVP 153.3K Reputation points MVP
    2025-03-05T21:31:17.2233333+00:00

    You can use this as a guide:

    https://office365itpros.com/2025/01/21/azure-automation-runbook-primer/

    You can then create a task to check this against the last time the sync was successful in Entra:

    (Get-MgOrganization  -Property OnPremisesLastSyncDateTime).OnPremisesLastSyncDateTime 

    Ignore the _ in the beginning and end of that command sample

    _(Get-MgOrganization  -Property OnPremisesLastSyncDateTime).OnPremisesLastSyncDateTime_ 
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.