blankton
blankton

Reputation: 13

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.

Upvotes: 1

Views: 11331

Answers (1)

Theo
Theo

Reputation: 61208

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

Upvotes: 6

Related Questions