Get-MgAllSite and Skip Tokens
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Get-MgAllSite コマンドレットとその skiptoken の処理から始め、報告された Invoke-MgGraphRequest の応答を nextLink の参照として使用します。コマンドレットがページングをどのように公開または追跡すべきかを判断し、その後、リクエストで 600 を超えるサイトを取得できることと、next-link トークンが想定どおり利用可能であることを確認します。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- C#
- スター
- 898
- フォーク
- 230
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 20
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoftgraph/msgraph-sdk-powershell のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
microsoftgraph/msgraph-sdk-powershell#3752 ·
メンテナーはふだん 1 日以内に返信
-
status:waiting-for-triage type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
microsoftgraph/msgraph-sdk-powershell#3751 ·
メンテナーはふだん 1 日以内に返信
-
status:waiting-for-triage type:bug
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
microsoftgraph/msgraph-sdk-powershell#3772 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
microsoftgraph/msgraph-sdk-powershell#3749 ·
メンテナーはふだん 1 日以内に返信
-
status:waiting-for-triage type:bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
microsoftgraph/msgraph-sdk-powershell#3741 ·
メンテナーはふだん 1 日以内に返信
microsoftgraph/msgraph-sdk-powershell の issue をすべて見る
似ている issue
-
area-ai untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
dotnet/extensions#7790 ·
メンテナーはふだん 1 日以内に返信
-
P2 testing
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
メンテナーはふだん 1 日以内に返信
-
area-Infrastructure-coreclr os-ios os-maccatalyst os-tvos untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dotnet/runtime#134766 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
0 - Backlog Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
BrighterCommand/Brighter#4444 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信