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

Time:02-16

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.

CodePudding user response:

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

  • Related