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.
Missing the `marks` around true. Should be this.
SystemInfo.DirectorySync[?DirectorySyncEnabled == `true` && DaysSinceLastSync_r > `0`].DaysSinceLastSync_r
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
Is this the same data as Organization.onPremisesSyncEnabled and onPremisesLastSyncDateTime ?
Figured it out. SystemInfo.DirectorySync[?DaysSinceLastSync_r > '-1'].DaysSinceLastSync_r returns the correct information.
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
OrganizationName: "Contoso"
DaysSinceLastSync_r: 82
DirectorySyncEnabled: true
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.
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(@)