Microsoft Entra の監視と正常性に関する Microsoft Graph PowerShell コマンドレット

Microsoft Entra の監視と正常性を使用すると、ディレクトリーへのすべての書き込み操作 (監査ログ) および認証データ (サインイン ログ) に関するアクティビティの詳細を取得することができます。 この情報は Microsoft Graph API を使用して入手できますが、ID の監視と正常性用の Microsoft Graph PowerShell コマンドレットを使用して、同じデータを取得できるようになりました。

この記事では、監査ログとサインイン ログに使用する Microsoft Graph PowerShell コマンドレットの概要について説明します。 Microsoft Graph PowerShell の概要

監査ログ

監査ログは、Microsoft Entra ID 内のさまざまな機能によって実行されたすべての変更のログを通して追跡可能性を提供します。 監査ログの例としては、ユーザー、アプリ、グループ、ロール、ポリシーの追加や削除など、Microsoft Entra ID 内のあらゆるリソースに対して行われる変更があります。

監査ログには Get-MgAuditLogDirectoryAudit コマンドレットを使用してアクセスします。

シナリオ PowerShell コマンド
アプリケーション表示名 Get-MgAuditLogDirectoryAudit -Filter "initiatedBy/app/displayName eq 'Azure AD Cloud Sync'"
カテゴリ Get-MgAuditLogDirectoryAudit -Filter "category eq 'ApplicationManagement'"
アクティビティの日付と時刻 Get-MgAuditLogDirectoryAudit -Filter "activityDateTime gt 2019-04-18"
上記のすべて Get-MgAuditLogDirectoryAudit -Filter "initiatedBy/app/displayName eq 'Azure AD Cloud Sync' and category eq 'ApplicationManagement' and activityDateTime gt 2019-04-18"

サインイン ログ

サインイン ログは、マネージド アプリケーションの使用状況とユーザー サインイン アクティビティに関する情報を提供します。

Get-MgAuditLogSignIn コマンドレットを使用して、サインイン ログにアクセスします。 その他のシナリオについては、次の表を参照してください。

シナリオ Microsoft Graph PowerShell コマンド
ユーザー表示名 Get-MgAuditLogSignIn -Filter "userDisplayName eq 'Timothy Perkins'"
作成の日付と時刻 Get-MgAuditLogSignIn -Filter "createdDateTime gt 2023-04-18T17:30:00.0Z" (すべて 4/18 の午後 17:30 以降)
Status Get-MgAuditLogSignIn -Filter "status/errorCode eq 50105"
アプリケーション表示名 Get-MgAuditLogSignIn -Filter "appDisplayName eq 'StoreFrontStudio [wsfed enabled]'"
上記のすべて Get-MgAuditLogSignIn -Filter "userDisplayName eq 'Timothy Perkins' and status/errorCode ne 0 and appDisplayName eq 'StoreFrontStudio [wsfed enabled]'"

次のステップ