Get-EntraBetaAuditDirectoryLog
ディレクトリ監査ログを取得します。
構文
Default (既定)
Get-EntraBetaAuditDirectoryLog
[-All]
[-Top <Int32>]
[-Filter <String>]
[-Property <String[]>]
[<CommonParameters>]
説明
Get-EntraBetaAuditDirectoryLog コマンドレットは、Microsoft Entra ID監査ログを取得します。
Microsoft Entra IDから監査ログを取得し、ユーザー、アプリ、デバイス、グループ管理、特権 ID 管理 (PIM)、アクセス レビュー、使用条件、ID 保護、パスワード管理 (SSPR と管理者のリセット)、セルフサービス グループ管理などのさまざまなサービスからのログをカバーします。
職場または学校アカウントを使用する委任されたシナリオでは、サインインしているユーザーは、必要なアクセス許可を持つサポートされているMicrosoft Entra ロールまたはカスタム ロールを持っている必要があります。 この操作は、次の最小特権ロールでサポートされています。
- レポートビューワー
- セキュリティ管理者
- セキュリティリーダー
例
例 1: すべてのログを取得する
Connect-Entra -Scopes 'AuditLog.Read.All, Directory.Read.All'
Get-EntraBetaAuditDirectoryLog -All
Id ActivityDateTime ActivityDisplayName Category CorrelationId
-- ---------------- ------------------- -------- -------------
Directory_aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb 17/07/2024 08:55:34 Add service principal ApplicationManagement aaaa0000-bb11-2222-33cc-444444dddddd
Directory_bbbbbbbb-1111-2222-3333-cccccccccccc 17/07/2024 07:31:54 Update user UserManagement bbbb1111-cc22-3333-44dd-555555eeeeee
SSGM_cccccccc-2222-3333-4444-dddddddddddd 17/07/2024 07:13:08 GroupsODataV4_GetgroupLifecyclePolicies GroupManagement cccc2222-dd33-4444-55ee-666666ffffff
このコマンドは、すべての監査ログを取得します。
例 2: グループ作成の監査ログを一覧表示する
Connect-Entra -Scopes 'AuditLog.Read.All, Directory.Read.All'
$groupId = (Get-EntraBetaGroup -SearchString 'Woodgrove DevOps').Id
Get-EntraBetaAuditDirectoryLog -Filter "
activityDisplayName eq 'Add group'
and targetResources/any(r:r/id eq '$groupId')"
Id ActivityDateTime ActivityDisplayName Category CorrelationId LoggedByService OperationType Result ResultReason
-- ---------------- ------------------- -------- ------------- --------------- ------------- ------ ------------
Directory_aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb 03/06/2025 22:22:17 Add group GroupManagement aaaa0000-bb11-2222-33cc-444444dddddd Core Directory Add success
このコマンドは、グループ作成のすべての監査ログを取得します。
例 3: 最近のグループ作成監査ログを取得する
Connect-Entra -Scopes 'AuditLog.Read.All, Directory.Read.All'
Get-EntraBetaAuditDirectoryLog -Filter "activityDisplayName eq 'Add group'" -Limit 5 |
Select-Object id, activityDateTime,
@{Name="InitiatedByUPN"; Expression={ $_.initiatedBy.user.userPrincipalName }},
result,
@{Name="GroupDisplayName"; Expression={ $_.targetResources[0].displayName }} |
Format-Table -AutoSize
Id ActivityDateTime InitiatedByUPN Result GroupDisplayName
-- ---------------- -------------- ------ ----------------
Directory_11111111-2222-3333-4444-555555555555 03/07/2025 18:30:45 admin@contoso.com success Woodgrove Developers
Directory_aaaa0000-bb11-2222-33cc-444444dddddd 03/06/2025 22:22:17 user1@contoso.com success Woodgrove DevOps
Directory_99999999-8888-7777-6666-555555555555 03/05/2025 15:10:12 admin2@contoso.com success Security Team
このコマンドは、最近のグループ作成監査ログを取得します。
例 4: ユーザーの更新された認証方法の詳細を表示する
Connect-Entra -Scopes 'AuditLog.Read.All, Directory.Read.All'
$userId = (Get-EntraBetaUser -UserId 'sawyerM@contoso.com').Id
Get-EntraBetaAuditDirectoryLog -Filter "category eq 'UserManagement' and LoggedByService eq 'Authentication Methods' and targetResources/any(r:r/id eq '$userId')"
Id ActivityDateTime ActivityDisplayName Category CorrelationId LoggedByService OperationType Result ResultReason
-- ---------------- ------------------- -------- ------------- --------------- ------------- ------ ------------
Authentication Methods_{GUID} 02/17/2025 13:20:08 User registered security info UserManagement aaaa0000-bb11-2222-33cc-444444dddddd Authentication Methods ServiceApi success User registered Fido2 Authentication Method
Authentication Methods_{GUID} 02/17/2025 13:19:57 Get passkey creation options UserManagement bbbb1111-cc22-3333-44dd-555555eeeeee Authentication Methods ServiceApi success Successfully retrieved passkey creation options.
Authentication Methods_{GUID} 02/15/2025 17:38:02 User registered security info UserManagement cccc2222-dd33-4444-55ee-666666ffffff Authentication Methods ServiceApi success User registered temporary access pass method
このコマンドは、ユーザーの更新された認証方法の詳細を取得します。
例 5: 検疫済みプロビジョニング ジョブを一覧表示する
Connect-Entra -Scopes 'AuditLog.Read.All, Directory.Read.All'
Get-EntraBetaAuditDirectoryLog -Filter "activityDisplayName eq 'Quarantine'" -Limit 1 |
Select-Object Id, ActivityDateTime, ActivityDisplayName, Category, LoggedByService, Result,
ResultReason,
@{Name="InitiatedByDisplayName"; Expression={ $_.targetResources[0].displayName }}
id : Sync_{GUID}
activityDateTime : 02/14/2025 04:23:38
activityDisplayName : Quarantine
category : ProvisioningManagement
loggedByService : Account Provisioning
result : failure
resultReason : This run profile is being quarantined because of: EncounteredQuarantineException; Error: Your ServiceNow credentials are invalid. Please obtain valid ServiceNow credentials, navigate to your ServiceNow enterprise application in the Azure Portal, and ente
r those details in the admin credentials section of the provisioning configuration page. For directions on how to input credentials into your application, review the tutorial specific to ServiceNow found here: https://docs.microsoft.com/en-us/azure/activ
e-directory/saas-apps/servicenow-provisioning-tutorial
InitiatedByDisplayName : ServiceNow
このコマンドは、検疫されたプロビジョニング ジョブを取得します。
例 6: 最初の n 個のログを取得する
Connect-Entra -Scopes 'AuditLog.Read.All, Directory.Read.All'
Get-EntraBetaAuditDirectoryLog -Top 1
Id ActivityDateTime ActivityDisplayName Category CorrelationId LoggedB
yServic
e
-- ---------------- ------------------- -------- ------------- -------
Directory_aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb_8IAPT_617717139 17/07/2024 08:55:34 Add service principal ApplicationManagement aaaa0000-bb11-2222-33cc-444444dddddd Core...
この例では、最初の N 個のログが返されます。
-Limitのエイリアスとして-Topを使用できます。
例 7: 特定の ActivityDisplayName を含む監査ログを取得する
Connect-Entra -Scopes 'AuditLog.Read.All, Directory.Read.All'
Get-EntraBetaAuditDirectoryLog -Filter "ActivityDisplayName eq 'Update rollout policy of feature'" -Top 1
Id ActivityDateTime ActivityDisplayName Category CorrelationId
-- ---------------- ------------------- -------- -------------
Application Proxy_aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb 16/07/2024 05:13:49 Update rollout policy of feature Authentication aaaa0000-bb11-2222-33cc-444444dddddd
このコマンドは、ActivityDisplayName で監査ログを取得する方法を示します。
-Limitのエイリアスとして-Topを使用できます。
例 8: 特定の結果を含むすべての監査ログを取得する
Connect-Entra -Scopes 'AuditLog.Read.All, Directory.Read.All'
Get-EntraBetaAuditDirectoryLog -Filter "result eq 'failure'" -All
このコマンドは、結果によって監査ログを取得する方法を示します。
例 9: ユーザーがグループに追加された日時を表示する
Connect-Entra -Scopes 'AuditLog.Read.All, Directory.Read.All'
$groupId = (Get-EntraBetaGroup -SearchString 'Contoso Group').Id
Get-EntraBetaAuditDirectoryLog -Filter "
activityDisplayName eq 'Add member to group'
and targetResources/any(r:r/type eq 'User')
and targetResources/any(r:r/id eq '$groupId' and r/type eq 'Group')"
Id ActivityDateTime ActivityDisplayName Category CorrelationId LoggedByService OperationType Result ResultReason
-- ---------------- ------------------- -------- ------------- --------------- ------------- ------ ------------
Directory_{GUID} 03/07/2025 23:16:31 Add member to group GroupManagement aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Core Directory Assign success
このコマンドは、ユーザーがグループに追加された日時を示します。
パラメーター
-All
すべてのページを一覧表示します。
パラメーターのプロパティ
| 型: | System.Management.Automation.SwitchParameter |
| 規定値: | False |
| ワイルドカードのサポート: | False |
| DontShow: | False |
パラメーター セット
(All)
| 配置: | Named |
| 必須: | False |
| パイプラインからの値: | False |
| プロパティ名別のパイプラインからの値: | False |
| 残りの引数からの値: | False |
-Filter
OData v4.0 フィルター ステートメント。 返されるオブジェクトを制御します。
パラメーターのプロパティ
| 型: | System.String |
| 規定値: | None |
| ワイルドカードのサポート: | False |
| DontShow: | False |
パラメーター セット
(All)
| 配置: | Named |
| 必須: | False |
| パイプラインからの値: | True |
| プロパティ名別のパイプラインからの値: | True |
| 残りの引数からの値: | False |
-Property
返されるプロパティを指定します。
パラメーターのプロパティ
| 型: | System.String[] |
| 規定値: | None |
| ワイルドカードのサポート: | False |
| DontShow: | False |
| Aliases: | Select |
パラメーター セット
(All)
| 配置: | Named |
| 必須: | False |
| パイプラインからの値: | False |
| プロパティ名別のパイプラインからの値: | False |
| 残りの引数からの値: | False |
-Top
返されるレコードの最大数。
パラメーターのプロパティ
| 型: | System.Int32 |
| 規定値: | None |
| ワイルドカードのサポート: | False |
| DontShow: | False |
| Aliases: | 極限 |
パラメーター セット
(All)
| 配置: | Named |
| 必須: | False |
| パイプラインからの値: | True |
| プロパティ名別のパイプラインからの値: | True |
| 残りの引数からの値: | False |
CommonParameters
このコマンドレットでは、一般的なパラメーター -Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction、-WarningVariable の各パラメーターがサポートされています。 詳細については、about_CommonParametersを参照してください。
メモ
Get-EntraBetaAuditDirectoryLogs は Get-EntraBetaAuditDirectoryLog の別名です。