Remove-MgBetaSecurityAuditLogQuery Does Not Work
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
調査の方向性
まず New-MgBetaSecurityAuditLogQuery、Get-MgBetaSecurityAuditLogQuery、Remove-MgBetaSecurityAuditLogQuery で失敗を再現し、その後、記録された DELETE /beta/security/auditLog/queries/{auditLogQuery-id} リクエストを調査します。404 の原因が SDK と Microsoft Graph API のどちらにあるかを特定します。既存の監査ログ クエリを正常に削除できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
Using New-MgBetaSecurityAuditLogQuery I can successfully create a query and using Get-MgBetaSecurityAuditLogQuery I can successfully retrieve a query. However, I am unable to Remove this query (or any other query) using Remove-MgBetaSecurityAuditLogQuery.
$query = Get-MgBetaSecurityAuditLogQuery -AuditLogQueryID $Identifier
# this succeeds, and the query object is viewable
Remove-MgBetaSecurityAuditLogQuery, however, fails, when called in any of the following ways:
Remove-MgBetaSecurityAuditLogQuery -AuditLogQueryID $Identifier
Remove-MgBetaSecurityAuditLogQuery -AuditLogQueryID $query.Id
Failure:
Remove-MgBetaSecurityAuditLogQuery_DeleteViaIdentity: {"Message":"No HTTP resource was found that matches the request URI 'https://o365adtsearchapi-na003-aks.eastus.cloudapp.azure.com/security/auditLog/queries('')'.","MessageDetail":"No type was found that matches the controller named 'queries'."}
Status: 404 (NotFound)
ErrorCode: UnknownError
Date: 2025-10-16T16:54:09
Headers:
Cache-Control : no-cache
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id :
client-request-id :
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"East US","Slice":"E","Ring":"5","ScaleUnit":"008","RoleInstance":"BL02EPF0001B4C8"}}
Date : Thu, 16 Oct 2025 16:54:09 GMT
Expected behavior
Remove-MgBetaSecurityAuditLogQuery should be able to be used to remove an existing query.
This seems to be an underlying problem with the API, see https://github.com/microsoftgraph/msgraph-beta-sdk-java/issues/1162
How to reproduce
$NewQuery = New-MgBetaSecurityAuditLogQuery -DisplayName 'Repro' -FilterStartDateTime $(get-date).AddDays(-1) -FilterEndDateTime $(get-date)
$RetrievedQuery = Get-MGBetaSecurityAuditLogQuery -AuditLogQueryID $NewQuery.Id
#attempt to delete the query
Remove-MgBetaSecurityAuditLogQuery -AuditLogQueryID $RetrievedQuery.Id
SDK Version
2.31.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```$myhash | Remove-MgBetaSecurityAuditLogQuery -Debug
DEBUG: [CmdletBeginProcessing]: - Remove-MgBetaSecurityAuditLogQuery begin processing with parameterSet 'DeleteViaIdentity'.
DEBUG: [Authentication]: - AuthType: 'AppOnly', TokenCredentialType: 'ClientSecret', ContextScope: 'Process', AppName: 'M365GraphAdmin'.
DEBUG: [Authentication]: - Scopes: [Directory.ReadWrite.All, Sites.FullControl.All, TeamSettings.ReadWrite.All, AuditLogsQuery-Exchange.Read.All, AuditLogsQuery-SharePoint.Read.All, AuditLogsQuery-Entra.Read.All, Sites.ReadWrite.All, AuditLogsQuery.Read.All, AuditActivity.Write, AuditLogsQuery-OneDrive.Read.All, Files.ReadWrite.All, AuditLog.Read.All, AuditLogsQuery-CRM.Read.All, AuditLogsQuery-Endpoint.Read.All, AuditActivity.Read].
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-MgBetaSecurityAuditLogQuery_DeleteViaIdentity" on target "Call remote 'DELETE /security/auditLog/queries/{auditLogQuery-id}' operation".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): a
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
DELETE
Absolute Uri:
https://graph.microsoft.com/beta/security/auditLog/queries/bee53e0a-2bf1-489d-bb4e-1641a31f93be
Headers:
Id : bee53e0a-2bf1-489d-bb4e-1641a31f93be
AuditLogQueryID : bee53e0a-2bf1-489d-bb4e-1641a31f93be
FeatureFlag : 00000003
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.26100; en-US),PowerShell/7.5.3
SdkVersion : graph-powershell-beta/2.31.0
client-request-id : e98fb6d1-4f94-4d7b-bbf0-2ab78d562d39
Accept-Encoding : gzip,deflate,br
Body:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
NotFound
Headers:
Cache-Control : no-cache
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : ed53f1b5-d724-46a9-8ca8-1be2c2d47d87
client-request-id : e98fb6d1-4f94-4d7b-bbf0-2ab78d562d39
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"East US","Slice":"E","Ring":"5","ScaleUnit":"010","RoleInstance":"MN1PEPF0002828D"}}
Date : Thu, 16 Oct 2025 17:38:38 GMT
Body:
{
"error": {
"code": "UnknownError",
"message": "{"Message":"No HTTP resource was found that matches the request URI 'https://o365adtsearchapi-na004-aks.eastus.cloudapp.azure.com/security/auditLog/queries('')'.","MessageDetail":"No type was found that matches the controller named 'queries'."}",
"innerError": {
"date": "2025-10-16T17:38:38",
"request-id": ",
"client-request-id": ""
}
}
}
Remove-MgBetaSecurityAuditLogQuery_DeleteViaIdentity: {"Message":"No HTTP resource was found that matches the request URI 'https://o365adtsearchapi-na004-aks.eastus.cloudapp.azure.com/security/auditLog/queries('')'.","MessageDetail":"No type was found that matches the controller named 'queries'."}
Status: 404 (NotFound)
ErrorCode: UnknownError
Date: 2025-10-16T17:38:38
Headers:
Cache-Control : no-cache
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id :
client-request-id :
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"East US","Slice":"E","Ring":"5","ScaleUnit":"010","RoleInstance":""}}
Date : Thu, 16 Oct 2025 17:38:38 GMT
Recommendation: See service error codes: https://learn.microsoft.com/graph/errors
DEBUG: [CmdletEndProcessing]: - Remove-MgBetaSecurityAuditLogQuery end processing.
</details>
### Configuration
_No response_
### Other information
_No response_
- 主要言語
- C#
- スター
- 902
- フォーク
- 233
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 29
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoftgraph/msgraph-sdk-powershell のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
microsoftgraph/msgraph-sdk-powershell#3752 ·
メンテナーはふだん 2 日以内に返信
-
status:waiting-for-triage type:bug
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
microsoftgraph/msgraph-sdk-powershell#3822 ·
メンテナーはふだん 2 日以内に返信
-
Microsoft.Graph.Authentication dependency Microsoft.Graph.Authentication.Loader.dll is unsignedオープンstatus:waiting-for-triage type:bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
microsoftgraph/msgraph-sdk-powershell#3819 ·
メンテナーはふだん 2 日以内に返信
-
Connect-MgGraph on 2.41 crashes when making a connection with cert, fixes when using 2.39 or lowerオープンstatus:waiting-for-triage type:bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
microsoftgraph/msgraph-sdk-powershell#3816 ·
メンテナーはふだん 2 日以内に返信
-
status:waiting-for-triage type:feature
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
microsoftgraph/msgraph-sdk-powershell#3806 · コメント 3 件 · リアクション 3 件 ·
メンテナーはふだん 2 日以内に返信
microsoftgraph/msgraph-sdk-powershell の issue をすべて見る
似ている issue
-
area:jobads-cv BE mvp P2
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
klasolsson81/jobbliggaren#2099 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
Esri/calcite-dotnet-toolkit#30 · リアクション 1 件 ·
-
kind:docs simplification size:S status:todo
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
elsa-workflows/elsa-foundation#2604 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
ProwlEngine/Prowl#413 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
VideoViewer: rotated (portrait phone) videos shown sideways when system decimal separator is a commaオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100