Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Microsoft Graph: Get-MgUser shows only 100 entries. How can I get all Users?

I am reading all Users of my Azure-AD with the cmdlet

Get-MgUser

The output shows exactly 100 Objects. I expect over 200 entries. How can I get the missing Objects?

I use this command to get the ID of every User.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

As the docs show, you can use either switch -All to the Get-MgUser cmdlet, which will list all pages, or use the -PageSize parameter where you can set the page size of results.

Apparently, the default pagesize is set to 100, so with PageSize you could do

Get-MgUser -PageSize 300  # or [int32]::MaxValue

Easier of course is to use the -All switch:

Get-MgUser -All

to receive all objects

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading