Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Get-MgAllSite and Skip Tokens

Abierto
#3,404 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
40/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
powershell
Área
api, cli

Línea de trabajo

Comience con el cmdlet Get-MgAllSite y su gestión de skiptoken, utilizando la respuesta informada de Invoke-MgGraphRequest como referencia para nextLink. Determine cómo debería exponer o seguir la paginación el cmdlet y, a continuación, verifique que las solicitudes puedan recuperar más de 600 sitios y que el token de next-link esté disponible como se espera.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Status: Needs Investigation type:bug
Describe the bug

The Get-MgAllSite cmdlet returns a maximum of 600 sites. The cmdlet supports a skiptoken parameter to take a nextlink and return the next page of data, but there's no obvious way of finding the token (which is returned by the underlying Graph API - see debug output below).

In other words, this works:

[array]$GraphSites = Invoke-MgGraphRequest -Uri $Uri -Method Get
$Graphsites

Name Value


value {Project Zaja, Office 365 for IT Pros (2026 Edition), Critical Project Planning - HR Advice, Critical Project Planning - Legal advice…}
@odata.nextLink https://graph.microsoft.com/v1.0/sites/getAllSites?$skiptoken=UGFnZWQ9VFJVRSZwX1RpbWVEZWxldGVkPSZwX0lEPTUyMw
@odata.context https://graph.microsoft.com/v1.0/$metadata#sites

This doesn't:

[array]$Sites = Get-MgAllSite
$Sites | Select-Object -First 5

DisplayName Id Name


Project Zaja redmondassociates.sharepoint.com,9ba323bf-cf4d-4d8b-a9dc-880cc2341977,971e2d7f-def2-4f61-ba98-50cd95795b13 Project Zaja
Office 365 for IT Pros (2026 Edition) redmondassociates.sharepoint.com,113046d4-4c00-4a8f-a0b0-9ce5a363cf9a,70e4385d-48f9-4d5e-95a0-f5e890978ac5 Office 365 for IT Pros (2026…
Critical Project Planning - HR Advice redmondassociates.sharepoint.com,8094d05f-eece-477a-a700-34a5d210b307,a9415985-41f2-4af4-a403-57fca1597f63 Critical Project Planning - …
Critical Project Planning - Legal advice redmondassociates.sharepoint.com,2d67176d-eb90-4d87-b51e-56b0b389e6e9,a9415985-41f2-4af4-a403-57fca1597f63 Critical Project Planning - …
MDO License Assignments redmondassociates.sharepoint.com,da416236-22fe-48af-960d-252b30e0d9d7,c2730fcf-4fbd-48b4-a127-b6c664222c21 MDO License Assignments

The cmdlet should support an All parameter to allow all sites to be retrieved.

Expected behavior

I expect a nextlink token to be available if Get-MgAllSites finds more than 600 sites.

How to reproduce

See above.

SDK Version

V2.30

Latest version known to work for scenario above?

No response

Known Workarounds

Use the Graph API

Debug output

Headers:
Cache-Control : no-store, no-cache
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : b017fe39-b336-45f2-8833-1638c8661947
client-request-id : 25dfb918-0a3a-44f1-bbc5-b23aff14bbba
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"North Europe","Slice":"E","Ring":"4","ScaleUnit":"008","RoleInstance":"DU2PEPF00045843"}}
splogid : da81c8a1-409e-a000-0bf7-a1ac56684946
odata-version : 4.0
Date : Tue, 23 Sep 2025 09:39:00 GMT

Body:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
"@odata.nextLink": "https://graph.microsoft.com/v1.0/sites/microsoft.graph.getAllSites()?$skiptoken=UGFnZWQ9VFJVRSZwX1RpbWVEZWxldGVkPSZwX0lEPTUyMw",
"value": [
{
"createdDateTime": "2025-09-23T09:24:29Z",
"id": "redmondassociates.sharepoint.com,9ba323bf-cf4d-4d8b-a9dc-880cc2341977,971e2d7f-def2-4f61-ba98-50cd95795b13",
"name": "Project Zaja",
"webUrl": "https://redmondassociates.sharepoint.com/sites/ProjectZaja",
"displayName": "Project Zaja",
"isPersonalSite": false,
"siteCollection": {
"hostname": "redmondassociates.sharepoint.com"
},
"root": {}

Click to expand log


<Log output here>

Configuration

$psversiontable

Name Value


PSVersion 7.5.3
PSEdition Core
GitCommitId 7.5.3
OS Microsoft Windows 10.0.26100
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Other information

No response

Lenguaje dominante
C#
Estrellas
902
Forks
233
Merge medio
1 d 3 h
PR fusionados (30 d)
24

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoftgraph/msgraph-sdk-powershell

Todos los issues de microsoftgraph/msgraph-sdk-powershell

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.