TinyAddicts #3 – List all users without a license in Microsoft 365

TinyAddicts is a series of ultra-short, ultra-useful scripts and snippets. No fluff – just pure, working code. Perfect for admins, devs, and anyone who values their time.

Scenario

Need to find users who exist in Entra ID but don’t have any Microsoft 365 licenses assigned? These accounts might be test users, onboarding leftovers, or simply inactive. Here’s a reliable one-liner to list them.

Code

Sample output

Notes

  • Requires User.Read.All or Directory.Read.All permission.
  • Works reliably without relying on unsupported Graph filters like assignedLicenses/$count.
  • Great for license cleanup, onboarding checks, or catching missed assignments.
  • You can also export the list to CSV:

More bite-sized scripts in the TinyAddicts series – simple tools, serious impact.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top