Skip to Main Content
Liongard Library

Welcome to Liongard Library, where Lions share! This is a community-led space where Liongard users can come to teach and learn from one another.
Share custom Metrics, get inspired and see what’s trending in the Pride.

Pride Etiquette:
➕ Have great custom Metrics? Add them as entries!
🌟 Want to use a Metric? Copy the query and
follow this doc.
👍 Tried a Metric from the Library? Like it!
📣 Have a question or feedback on a Metric? Add a comment!
🔎 Not sure where to start? Learn about Metrics and how to write them.
💬 Need help writing a metric or want to help support others? Join the conversation in our Liongard Lounge #metrics slack channel.


🥴 See something off? Open a support chat to let us know.

Created by Robbie Kibler
Created on Jul 27, 2021

Azure Active Directory: Days Since Last AADC Sync

Counts the number of days since the last Azure Active Directory Connect (AADC) sync. Useful for determining if there is an issue as it should always be <1.

Query

SystemInfo.DirectorySync[?DaysSinceLastSync_r > `0`] | length(@)

  • Attach files
  • Jordan Docter
    Reply
    |
    May 18, 2022

    Missing the `marks` around true. Should be this.

    SystemInfo.DirectorySync[?DirectorySyncEnabled == `true` && DaysSinceLastSync_r > `0`].DaysSinceLastSync_r

  • HappyEarthDay
    Reply
    |
    May 17, 2022

    I believe this has been superceded by the built in Metric:

    Azure Active Directory: Organizations With Directory Sync Enabled And >= 1 Day Since Last Sync List

    SystemInfo.DirectorySync[?DaysSinceLastSync_r > `0` && DirectorySyncEnabled].OrganizationName

  • Eric Vollbrecht
    Reply
    |
    Apr 12, 2022

    Is this the same data as Organization.onPremisesSyncEnabled and onPremisesLastSyncDateTime ?

  • Guest
    Reply
    |
    Feb 10, 2022

    Figured it out. SystemInfo.DirectorySync[?DaysSinceLastSync_r > '-1'].DaysSinceLastSync_r returns the correct information.

  • Guest
    Reply
    |
    Feb 10, 2022

    When I use SystemInfo.DirectorySync[?DaysSinceLastSync_r > `0`] | length(@) or SystemInfo.DirectorySync[?DirectorySyncEnabled == true && DaysSinceLastSync_r > `0`] | length(@) on a client with raw data of

    DirectorySync: Array(1)

    0: Object

    1. OrganizationName: "Contoso"

    2. DaysSinceLastSync_r: 82

    3. DirectorySyncEnabled: true

    4. DirectoryLastSyncDate: "2021-11-19T01:56:07Z"

    I get QUERY RESULTS 0. When I change it to a client that has synced less than an hour ago. I get QUERY RESULTS 0. I'm thinking I'm missing something with this one.

  • Chris Holliman
    Reply
    |
    Aug 26, 2021

    An extension to this is to check if AD Sync is enabled in order to eliminate alerts for no sync on "not enabled" clients:

    SystemInfo.DirectorySync[?DirectorySyncEnabled == true && DaysSinceLastSync_r > `0`] | length(@)