Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
guyhorn
New Member

How to get all ACTIVE Azure AD users

Hi. Active user is a user who logs-in. Do not confuse that with accountEnabled.

 

Azure AD reports that in the SigninLogs. 

 

I use this one now:

 

"set truncationmaxrecords=600000;SigninLogs | where Category == 'SignInLogs' | summarize count() by UserPrincipalName"

But i'm not sure it is any good. 

 

And the maxrecords seams only to work downwords. So I can ask for less records but not fot more. How can I increase the records number? I have 800K users to report.

5 REPLIES 5
lbendlin
Super User
Super User

No. I want to get all user's last login date. Therefore I need to get them all. I now founf the query: 

 

$signInQuery = $signInQuery = "set notruncation;SigninLogs | summarize count() by UserPrincipalName"

 

But even setting notruncationretrievs only 500000 users.  And I have 750000.

PS: this works and retrieve 30 records:\

 

$signInQuery = "set truncationmaxrecords=30;SigninLogs | summarize count() by UserPrincipalName"

With that amount of users you likely have subdomains. You could run separate queries for each subdomain and then concatenate.

No. For two reaons. I do have an Azure AD domain with almost a million users. But above all,AAD has no sub domains.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.