You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ChrisB9907 That is correct. We have prototyped a solution that enables automatic paging and once we figure out how to turn it off by default, we will add it to our packages.
Get-MgUser -> Return first page
Get-MgUser -top 100 -> return a page of 100
Get-MgUser -top All -> would page all results
Get-MgUser -top 2000 -> would page all results up to 2000
Get-MgUser -Limit 2000 -> Limit is an alias top
Can we make paging off by default?
Can we bypass the top paramter integer datatype to add support for all?
Can we implement our on limit on a set of pages.
Option 2
Get-MgUser -> Return first page
Get-MgUser -top 100 -> return a page of 100
Get-MgUser -All -> return all pages
Get-MgUser -All -top 2000 -> return all pages up to 2000
Get-MgUser -top 2000 -> Values larger than 999 cause implicit -All
Get-MgUser -Limit 2000 -> Limit is an alias to top
I would say Option 2 would be better as it would be consistent with the existing Graph API (unless that is planning on being changed as well) or as something that would be better (in my eyes anyhow) give the user the ability to pick as many pages they want to get back, defaulting the users to 100 objects per page. Something like Get-MgUser -PageLimit 1 (this would also be the default if the parameter is excluded) and to get all results Get-MgUser -All. This might also help out slower connections as less data per page is being returned.
I prefer option 2 approach. I am most familiar with the way PowerShell modules for SharePoint Online and Exchange Online handle this. Both return a default number of results but then require adding a parameter (-Limit and -ResultSize respectively) for additional results. I don't like the inconsistency where SPO has -Limit "All" and EXO has -ResultSize "Unlimited" to get all results but understand built by completely different teams. Hopefully other teams / modules have an example or common consensus of the preferred approach.
rbalsleyMSFT, that looks like service issue. Please post it on StackOverflow with intune, microsoft-graph-intune and microsoftgraph tags so that the workload owners can respond to it. The issue can also be reproed on Graph Explorer.
Activity
peombwa commentedon Oct 3, 2019
Investigate how to support paging of collections using NextLink.
ChrisB9907 commentedon Feb 29, 2020
There is currently no way to get more than the top 999 users without paging and the -skip param isn't available on Get-MgUser
darrelmiller commentedon Feb 29, 2020
ChrisB9907 That is correct. We have prototyped a solution that enables automatic paging and once we figure out how to turn it off by default, we will add it to our packages.
Windos commentedon Mar 17, 2020
My preference on implementing the automated paging is putting it behind an -All switch parameter.
The key to avoid backlash, regardless of the name that ends up being used is not making it a Boolean parameter.
I really hate AzureAD's implementation with "-All $true"
darrelmiller commentedon Mar 18, 2020
Option 1
Get-MgUser -> Return first page
Get-MgUser -top 100 -> return a page of 100
Get-MgUser -top All -> would page all results
Get-MgUser -top 2000 -> would page all results up to 2000
Get-MgUser -Limit 2000 -> Limit is an alias top
Can we make paging off by default?
Can we bypass the top paramter integer datatype to add support for all?
Can we implement our on limit on a set of pages.
Option 2
Get-MgUser -> Return first page
Get-MgUser -top 100 -> return a page of 100
Get-MgUser -All -> return all pages
Get-MgUser -All -top 2000 -> return all pages up to 2000
Get-MgUser -top 2000 -> Values larger than 999 cause implicit -All
Get-MgUser -Limit 2000 -> Limit is an alias to top
ChrisB9907 commentedon Mar 19, 2020
I would say Option 2 would be better as it would be consistent with the existing Graph API (unless that is planning on being changed as well) or as something that would be better (in my eyes anyhow) give the user the ability to pick as many pages they want to get back, defaulting the users to 100 objects per page. Something like Get-MgUser -PageLimit 1 (this would also be the default if the parameter is excluded) and to get all results Get-MgUser -All. This might also help out slower connections as less data per page is being returned.
rbalsleyMSFT commentedon Mar 27, 2020
Peter Ombwa (@peombwa) Darrel (@darrelmiller) should -skip $true work for Get-MgAuditLogSignIn? If it's supposed to work, how do I set AllowedQueryOptions?
BrianTJackett commentedon Mar 30, 2020
I prefer option 2 approach. I am most familiar with the way PowerShell modules for SharePoint Online and Exchange Online handle this. Both return a default number of results but then require adding a parameter (-Limit and -ResultSize respectively) for additional results. I don't like the inconsistency where SPO has -Limit "All" and EXO has -ResultSize "Unlimited" to get all results but understand built by completely different teams. Hopefully other teams / modules have an example or common consensus of the preferred approach.
peombwa commentedon Apr 16, 2020
rbalsleyMSFT, that looks like service issue. Please post it on StackOverflow with
intune,microsoft-graph-intuneandmicrosoftgraphtags so that the workload owners can respond to it. The issue can also be reproed on Graph Explorer.