Skip to content

Investigate paging of collections #11

Closed

Description

Activity

  1. peombwa commented on Oct 3, 2019

    @peombwa
    Member

    Investigate how to support paging of collections using NextLink.

  2. added this to the OnDeck milestone on Nov 1, 2019
  3. ChrisB9907 commented on Feb 29, 2020

    @ChrisB9907

    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

  4. darrelmiller commented on Feb 29, 2020

    @darrelmiller
    ContributorAuthor

    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.

  5. Windos commented on Mar 17, 2020

    @Windos

    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"

  6. darrelmiller commented on Mar 18, 2020

    @darrelmiller
    ContributorAuthor

    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

  7. ChrisB9907 commented on Mar 19, 2020

    @ChrisB9907

    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.

  8. rbalsleyMSFT commented on Mar 27, 2020

    @rbalsleyMSFT

    Peter Ombwa (@peombwa) Darrel (@darrelmiller) should -skip $true work for Get-MgAuditLogSignIn? If it's supposed to work, how do I set AllowedQueryOptions?

    PS C:\Windows\system32> Get-MgAuditLogSignIn -Skip $True | export-csv -Path c:\temp\signin.csv -Force
    Get-MgAuditLogSignIn : Query option 'Skip' is not allowed. To allow it, set the 'AllowedQueryOptions' property on
    EnableQueryAttribute or QueryValidationSettings.
    At line:1 char:1
    + Get-MgAuditLogSignIn -Skip $True | export-csv -Path c:\temp\signin.cs ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: ({ Top = , Skip ...= , Expand =  }:<>f__AnonymousType2`8) [Get-MgAudit
       LogSignIn_List], Exception
        + FullyQualifiedErrorId : Microsoft.Graph.PowerShell.Cmdlets.GetMgAuditLogSignIn_List
    
  9. BrianTJackett commented on Mar 30, 2020

    @BrianTJackett
    Contributor

    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.

  10. peombwa commented on Apr 16, 2020

    @peombwa
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P1enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions