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.

Categories Microsoft 365
Created by Lamont Largie
Created on Nov 20, 2024

Inactive Users with Assigned Licenses

Microsoft 365: Inactive Users with Assigned Licenses

Category: User Activity & Licensing


Description:

Identifies Microsoft 365 users with assigned licenses who have not signed in (either interactively or non-interactively) for more than 30 days. It provides details about the user’s display name, assigned licenses, and the number of days since their last sign-in activity.


Purpose:

To ensure license optimization by identifying inactive users who are still consuming valuable licenses, enabling proactive management and cost reduction.


How It Works:

  • Filtering: Extracts user accounts where licenses are assigned, the account is enabled, and last sign-in activity (both interactive and non-interactive) exceeds 30 days.

  • Output: Presents data as a table with columns for:

    • User Display Name

    • Assigned License (or "Not Assigned" if no licenses are allocated)

    • Days since last non-interactive sign-in

    • Days since last interactive sign-in

    • Separator row (--) for better readability


Beneficiaries:

  • IT Administrators: Gain visibility into inactive users with assigned licenses to optimize resource allocation.

  • Finance Teams: Identify opportunities for cost-saving by reclaiming unused licenses.

  • Operations Teams: Streamline licensing audits and compliance reporting.


Notes:

  • Making Changes:

    • To adjust the inactivity threshold, change the 30 in the time_since conditions to a desired value (e.g., 60 for a 2-month threshold).

  • Why Changes Are Valuable:

    • Custom Thresholds: Different organizations may have varying definitions of inactivity based on their operational requirements.

    • Granularity: Adding filters for user groups or roles allows targeted insights for specific teams or departments.

Query

Users[?Assigned_Products != null && Assigned_Products != '' && accountEnabled == `true` && (time_since(signInActivity.lastNonInteractiveSignInDateTime, 'days') > `30` || time_since(signInActivity.lastSignInDateTime, 'days') > `30`)] .[ ['User:' Display_Name], ['Assigned License:' Assigned_Products || 'Not Assigned'], ['Days Since Last Non-Interactive Sign In:' time_since(signInActivity.lastNonInteractiveSignInDateTime, 'days')],['Days Since Last Interactive Sign In:' time_since(signInActivity.lastSignInDateTime, 'days')], ['--'] ][]

  • Attach files