Configure Windows event auditing
In brief
The documentation now describes automatic Windows event auditing for sensor v3.x on domain controllers, AD FS, AD CS, and Microsoft Entra Connect servers. Sensor v2.x and opted-out v3.x deployments still require manual configuration. AD CS requires an existing CA audit filter.
What Defender admins need to know
Administrators deploying sensor v3.x on these server types can use automatic auditing; verify that an AD CS audit filter already exists.
Summaries are generated from the documentation change itself.
Documentation change
The comparison below shows only the changed extract. Use the full-page view for complete context.
Configure Windows event auditing
Configure auditing using one of these methods:
- Automatic configuration for sensor v3.x on domain
controllerscontrollers, AD FS, AD CS, and Microsoft Entra Connect servers (recommended) - Manual configuration for sensor v2.
x, servers that aren't domain controllers,x or if you opted out of automatic auditing - PowerShell configuration
- Required Windows events for all server types
Configure Defender for Identity to collect Windows events automatically
If you're deploying the Defender for Identity sensor v3.x on domain controllers,x, use automatic Windows auditing. This is the recommended approach; itapproach requires no manual configuration and handles all auditing settings for you.
Turn on automatic Windows auditing
To enable automatic Windows auditing in the Defender portal, complete the following steps:
- In the Microsoft Defender portal, go to Settings, and then Identities.
- In the General section, select Advanced features.
- Turn on Automatic Windows auditing configuration.
- Directory services advanced auditing: Adds audit entries to the domain root object's System Access Control List (SACL) to enable required directory service auditing.
- NTLM auditing: Uses standard Windows Registry APIs to configure the required NTLM auditing registry values.
- Domain object auditing: Modifies the SACL on the Configuration partition to capture changes to directory service configuration objects.
ADFSAD FS auditing: Automatically configures the following settings:- Object-level auditing on the AD FS configuration container: Adds audit entries to the object's System Access Control List (SACL) of the AD FS configuration container, to enable auditing of AD FS-related directory objects.
- Group Policy for event auditing: Configures the Audit Application Generated advanced audit policy (Success and Failure) on the local system by using the Windows Local Security Authority (LSA) audit policy APIs under the sensor's local system account.
- Other AD FS auditing settings aren't included in automatic auditing and remain manual, such as AD FS event auditing in AD FS Management and verbose logging for AD FS events.
- AD CS auditing: Writes the required value to the certificate authority (CA) audit filter in the CA's registry configuration. Automatic auditing modifies an existing audit filter but doesn't create one, so the CA must already have an audit filter configured. The new value takes effect after the Certificate Services (
certsvc) service restarts. Until the service restarts, Defender for Identity raises a health alert that prompts you to restart it. - Microsoft Entra Connect auditing: Configures the Audit Logon advanced audit policy (Success and Failure) on Microsoft Entra Connect servers by using the Windows LSA audit policy APIs.
- Windows audit policy: Configures the local Windows audit policies using the Windows
Local Security Authority (LSA)LSA audit policy APIs.
- Applies auditing settings directly to the local system policy of the
domain controller. Sends health alerts about the configuration state.server.- Runs once every 24 hours.
Configure Windows event collection manually
This section includes instructions for manually configuring Windows event collection. Use these steps if you're deploying sensor v2.x, deploying on AD FS, AD CS, or Entra Connect servers that aren't domain controllers,x or if you opted out of automatic auditing for sensor v3.x.
The following sections describe configuration for each server type:
Configure Directory Services Advanced Auditing
The following procedure describes how to modify your domain controller's Audit (Premium) Policy settings for Defender for Identity.
- Sign in to the server as Domain Administrator.
- Open the Group Policy Management Editor from Server Manager > Tools > Group Policy Management. | Audit policy | Subcategory | Triggers event IDs | | --- |---|---| | Account Logon | Audit Credential Validation | 4776 | | Account Management | Audit Computer Account ManagementFailure auditing note | 4741, 4743 | | Account Management | Audit Distribution Group ManagementFailure auditing note | 4753, 4763 | | Account Management | Audit Security Group ManagementFailure auditing note | 4728, 4729, 4730, 4732, 4733, 4756, 4757, 4758 | | Account Management | Audit User Account Management | 4726 | | DS Access | Audit Directory Service ChangesSee note | 5136 | | System | Audit Security System ExtensionSee note | 7045 |
Configure Object-level auditing on the AD FS configuration folder
To configure object-level auditing on the AD FS configuration folder, complete the following steps:
- Go to the Active Directory Users and Computers console, and select the domain where you want to enable the logs.
- Go to Program Data > Microsoft > ADFS.
Configure auditing on an AD FS server
This sectionThe following procedure describes how to modify your Active Directory Federation Services (AD FS) audit configurations for Defender for Identity.
Configure a Group Policy for event auditing
To configure Group Policy-based event auditing for AD FS, complete the following steps:
- Create a group policy to apply to your Active Directory Federation Services (AD FS).
- Configure the following auditing settings:
Configure AD FS event auditing in AD FS Management
To enable AD FS event auditing in AD FS Management, complete the following steps:
Select Start > Programs > Administrative Tools > AD FS Management.
Go to Actions > Edit Federation Service Properties.
Select the Events tab.
Configure auditing on the certificate authority (CA) using one of the following methods:
- To configure CA auditing using
PowerShell, run:PowerShell, set the CA audit filter to enable full auditing and then restart the Certificate Services service for the change to take effect:
- To configure CA auditing using
certutil -setreg CA\AuditFilter 127
Restart-Service certsvc
This command updates the CA audit settings and restarts the Certificate Services service so the changes take effect.
To configure CA auditing in the Defender portal:
- Select Start > Certification Authority (MMC Desktop application). Right-click your CA's name and select Properties.
To configure auditing on Microsoft Entra Connect servers:
Create a group policy to apply to your Microsoft Entra Connect servers.
Edit the group policy and configure the following auditing settings:
- Go to Computer Configuration\Policies\Windows Settings\Security Settings\Advanced Audit Policy Configuration\Audit Policies\Logon/Logoff\Audit Logon.
You need the configuration container audit only for environments that currently have or previously had Microsoft Exchange. These environments have an Exchange container located within the domain's Configuration section.
Active Directory replicates the configuration container throughout the forest, so configure auditing once for the entire forest. The health alert might appear for multiple domains because sensors in each domain report the state of the shared configuration container.
- Open the ADSI Edit tool.
- Select Start > Run, enter
ADSIEdit.msc, and then select OK. - In the Action menu, select Connect to.
To view your audit policies:
Use the Get-MDIConfiguration cmdlet to retrieve the current Defender for Identity configuration values in domain or local machine mode:mode. Use the following syntax to view the current configuration for a specific mode and configuration set:
Get-MDIConfiguration [-Mode] <String> [-Configuration] <String[]>
**To configure your settings:**
Use the following syntax to apply one or more Defender for Identity configurations in domain or local machine mode:configuration settings and optionally control GPO creation and linking behavior:
```powershell
Set-MDIConfiguration [-Mode] <String> [-Configuration] <String[]> [-CreateGpoDisabled] [-SkipGpoLink] [-Force]
- `SkipGpoLink` specifies that GPO links aren't created.
- `Force` specifies that the configuration is set or GPOs are created without validating the current state.
The following example applies the full recommendedall supported Defender for Identity domain configuration set through Group Policysettings in domain mode, createsone operation, creating the group policy objects,objects and linkslinking them:
```powershell
Set-MDIConfiguration -Mode Domain -Configuration All
@@ -1,14 +1,14 @@ --- title: Configure Windows event auditing description: Configure Windows event auditing for Defender for Identity sensors. Learn automatic, manual, and PowerShell methods to enable required audit policies.-ms.date: 06/15/2026+ms.date: 08/10/2026 ms.topic: how-to ms.custom:- - msecd-doc-authoring-1014- - msecd-doc-authoring-106+ - msecd-doc-authoring-1015 - sfi-image-nochange ms.reviewer: rlitinsky ai-usage: ai-assisted+#customer intent: As a security admin, I want to configure Windows event auditing for Defender for Identity sensors so that required events are available for detections. --- # Configure Windows event auditing@@ -17,8 +17,8 @@ Configure Windows event auditing to enable Defender for Identity detections. The Configure auditing using one of these methods: -- [Automatic configuration](#configure-defender-for-identity-to-collect-windows-events-automatically) for sensor v3.x on domain controllers (recommended)-- [Manual configuration](#configure-windows-event-collection-manually) for sensor v2.x, servers that aren't domain controllers, or if you opted out of automatic auditing+- [Automatic configuration](#configure-defender-for-identity-to-collect-windows-events-automatically) for sensor v3.x on domain controllers, AD FS, AD CS, and Microsoft Entra Connect servers (recommended)+- [Manual configuration](#configure-windows-event-collection-manually) for sensor v2.x or if you opted out of automatic auditing - [PowerShell configuration](#configure-windows-event-collection-using-powershell) - [Required Windows events](#required-windows-events) for all server types @@ -28,10 +28,12 @@ If you configure auditing properly, Windows event auditing has minimal effect on ## Configure Defender for Identity to collect Windows events automatically -If you're deploying sensor v3.x on domain controllers, use automatic Windows auditing. This is the recommended approach; it requires no manual configuration and handles all auditing settings for you.+If you're deploying the Defender for Identity sensor v3.x, use automatic Windows auditing. This approach requires no manual configuration and handles all auditing settings for you. ### Turn on automatic Windows auditing +To enable automatic Windows auditing in the Defender portal, complete the following steps:+ 1. In the [Microsoft Defender portal](https://security.microsoft.com), go to **Settings**, and then **Identities**. 1. In the **General** section, select **Advanced features**. 1. Turn on **Automatic Windows auditing configuration**.@@ -46,14 +48,18 @@ When enabled, the sensor automatically: - **Directory services advanced auditing**: Adds audit entries to the domain root object's System Access Control List (SACL) to enable required directory service auditing. - **NTLM auditing**: Uses standard Windows Registry APIs to configure the required NTLM auditing registry values. - **Domain object auditing**: Modifies the SACL on the Configuration partition to capture changes to directory service configuration objects.- - **ADFS auditing**: Adds audit entries to the object's System Access Control List (SACL) of the AD FS configuration container, to enable auditing of AD FS-related directory objects.- - **Windows audit policy**: Configures the local Windows audit policies using the Windows Local Security Authority (LSA) audit policy APIs.-- Applies auditing settings directly to the local system policy of the domain controller.-- Sends health alerts about the configuration state.+ - **AD FS auditing**: Automatically configures the following settings:+ - **Object-level auditing on the AD FS configuration container**: Adds audit entries to the object's System Access Control List (SACL) of the AD FS configuration container, to enable auditing of AD FS-related directory objects.+ - **Group Policy for event auditing**: Configures the **Audit Application Generated** advanced audit policy (Success and Failure) on the local system by using the Windows Local Security Authority (LSA) audit policy APIs under the sensor's local system account.+ - Other AD FS auditing settings aren't included in automatic auditing and remain manual, such as AD FS event auditing in AD FS Management and verbose logging for AD FS events.+ - **AD CS auditing**: Writes the required value to the certificate authority (CA) audit filter in the CA's registry configuration. Automatic auditing modifies an existing audit filter but doesn't create one, so the CA must already have an audit filter configured. The new value takes effect after the Certificate Services (`certsvc`) service restarts. Until the service restarts, Defender for Identity raises a health alert that prompts you to restart it.+ - **Microsoft Entra Connect auditing**: Configures the **Audit Logon** advanced audit policy (Success and Failure) on Microsoft Entra Connect servers by using the Windows LSA audit policy APIs.+ - **Windows audit policy**: Configures the local Windows audit policies using the Windows LSA audit policy APIs.+- Applies auditing settings directly to the local system policy of the server. - Runs once every 24 hours. > [!NOTE]-> - Automatic Windows event auditing is supported for domain controllers that use the Defender for Identity sensor version 3.x only. It doesn't apply to v2.x domain controllers or to AD FS, AD CS, and Microsoft Entra Connect servers that aren't domain controllers. For those servers, [configure Windows event auditing manually](#configure-windows-event-collection-manually).+> - Automatic Windows event auditing is supported only for domain controllers and AD FS, AD CS, and Microsoft Entra Connect servers that use Defender for Identity sensor v3.x. For servers that use sensor v2.x, [configure Windows event auditing manually](#configure-windows-event-collection-manually). > - If you don't turn on automatic Windows auditing, you **must** [configure Windows event auditing manually](#configure-windows-event-collection-manually) or by [configuring Windows event collection using PowerShell](#configure-windows-event-collection-using-powershell). > - GPO settings can conflict with local settings set by the sensor. @@ -160,10 +166,10 @@ Before configuring Windows event collection manually, you can run a PowerShell s ## Configure Windows event collection manually -This section includes instructions for manually configuring Windows event collection. Use these steps if you're deploying sensor v2.x, deploying on AD FS, AD CS, or Entra Connect servers that aren't domain controllers, or if you opted out of automatic auditing for sensor v3.x.+This section includes instructions for manually configuring Windows event collection. Use these steps if you're deploying sensor v2.x or if you opted out of automatic auditing for sensor v3.x. > [!NOTE]-> **Known issue:** In some v3 sensor environments, health alerts about Windows event auditing might persist even when auditing is correctly configured. This primarily occurs with manual auditing configuration, such as using Group Policy or PowerShell. The sensor remains healthy and detections aren't affected. To resolve, enable **Automatic Windows auditing configuration** in the Defender for Identity portal under **Settings** > **Advanced features**.+> **Known issue:** In some sensor v3.x environments, health alerts about Windows event auditing might persist even when auditing is correctly configured. This primarily occurs with manual auditing configuration, such as using Group Policy or PowerShell. The sensor remains healthy and detections aren't affected. To resolve, enable **Automatic Windows auditing configuration** in the Defender for Identity portal under **Settings** > **Advanced features**. The following sections describe configuration for each server type: @@ -185,7 +191,7 @@ To configure auditing on a domain controller, complete the following steps: #### Configure Directory Services Advanced Auditing -This section describes how to modify your domain controller's Audit (Premium) Policy settings for Defender for Identity.+The following procedure describes how to modify your domain controller's Audit (Premium) Policy settings for Defender for Identity. 1. Sign in to the server as **Domain Administrator**. 1. Open the Group Policy Management Editor from **Server Manager** > **Tools** > **Group Policy Management**.@@ -208,9 +214,9 @@ This section describes how to modify your domain controller's Audit (Premium) Po | Audit policy | Subcategory | Triggers event IDs | | --- |---|---| | **Account Logon** | **Audit Credential Validation** | 4776 |- | **Account Management** | **Audit Computer Account Management**<sup>[See note](#failure)</sup> | 4741, 4743 |- | **Account Management** | **Audit Distribution Group Management**<sup>[See note](#failure)</sup> | 4753, 4763 |- | **Account Management** | **Audit Security Group Management**<sup>[See note](#failure)</sup> | 4728, 4729, 4730, 4732, 4733, 4756, 4757, 4758 |+ | **Account Management** | **Audit Computer Account Management**<sup>[Failure auditing note](#failure)</sup> | 4741, 4743 |+ | **Account Management** | **Audit Distribution Group Management**<sup>[Failure auditing note](#failure)</sup> | 4753, 4763 |+ | **Account Management** | **Audit Security Group Management**<sup>[Failure auditing note](#failure)</sup> | 4728, 4729, 4730, 4732, 4733, 4756, 4757, 4758 | | **Account Management** | **Audit User Account Management** | 4726 | | **DS Access** | **Audit Directory Service Changes**<sup>[See note](#failure)</sup> | 5136 | | **System** | **Audit Security System Extension**<sup>[See note](#failure)</sup> | 7045 |@@ -325,6 +331,8 @@ To configure domain object auditing: #### Configure Object-level auditing on the AD FS configuration folder +To configure object-level auditing on the AD FS configuration folder, complete the following steps:+ 1. Go to the **Active Directory Users and Computers** console, and select the domain where you want to enable the logs. 1. Go to **Program Data** > **Microsoft** > **ADFS**. @@ -347,10 +355,12 @@ To configure domain object auditing: ### Configure auditing on an AD FS server -This section describes how to modify your Active Directory Federation Services (AD FS) audit configurations for Defender for Identity.+The following procedure describes how to modify your Active Directory Federation Services (AD FS) audit configurations for Defender for Identity. #### Configure a Group Policy for event auditing +To configure Group Policy-based event auditing for AD FS, complete the following steps:+ 1. Create a group policy to apply to your Active Directory Federation Services (AD FS). 1. Configure the following auditing settings: @@ -363,6 +373,8 @@ This section describes how to modify your Active Directory Federation Services ( #### Configure AD FS event auditing in AD FS Management +To enable AD FS event auditing in AD FS Management, complete the following steps:+ 1. Select **Start** > **Programs** > **Administrative Tools** > **AD FS Management**. 1. Go to **Actions** > **Edit Federation Service Properties**. 1. Select the **Events** tab.@@ -396,15 +408,13 @@ If you're working with a dedicated server that has Active Directory Certificate 1. Configure auditing on the certificate authority (CA) using one of the following methods: - - **To configure CA auditing using PowerShell, run:**+ - **To configure CA auditing using PowerShell**, set the CA audit filter to enable full auditing and then restart the Certificate Services service for the change to take effect: ```powershell certutil -setreg CA\AuditFilter 127 Restart-Service certsvc ``` -This command updates the CA audit settings and restarts the Certificate Services service so the changes take effect.- - **To configure CA auditing in the Defender portal:** 1. Select **Start** > **Certification Authority (MMC Desktop application)**. Right-click your CA's name and select **Properties**.@@ -422,7 +432,7 @@ This command updates the CA audit settings and restarts the Certificate Services To configure auditing on Microsoft Entra Connect servers: -1. Create a group policy to apply to your Microsoft Entra Connect servers. +1. Create a group policy to apply to your Microsoft Entra Connect servers. 1. Edit the group policy and configure the following auditing settings: 1. Go to **Computer Configuration\Policies\Windows Settings\Security Settings\Advanced Audit Policy Configuration\Audit Policies\Logon/Logoff\Audit Logon**.@@ -435,6 +445,8 @@ To configure auditing on Microsoft Entra Connect servers: You need the configuration container audit only for environments that currently have or previously had Microsoft Exchange. These environments have an Exchange container located within the domain's Configuration section. +Active Directory replicates the configuration container throughout the forest, so configure auditing once for the entire forest. The health alert might appear for multiple domains because sensors in each domain report the state of the shared configuration container.+ 1. Open the ADSI Edit tool. 1. Select **Start** > **Run**, enter `ADSIEdit.msc`, and then select **OK**. 1. In the **Action** menu, select **Connect to**.@@ -471,7 +483,7 @@ The following commands show how to modify your domain controller's Audit (Premiu **To view your audit policies:** -Use the `Get-MDIConfiguration` cmdlet to retrieve the current Defender for Identity configuration values in domain or local machine mode:+Use the `Get-MDIConfiguration` cmdlet to retrieve the current Defender for Identity configuration values in domain or local machine mode. Use the following syntax to view the current configuration for a specific mode and configuration set: ```powershell Get-MDIConfiguration [-Mode] <String> [-Configuration] <String[]>@@ -484,7 +496,7 @@ Where: **To configure your settings:** -Use the following syntax to apply one or more Defender for Identity configurations in domain or local machine mode:+Use the following syntax to apply Defender for Identity configuration settings and optionally control GPO creation and linking behavior: ```powershell Set-MDIConfiguration [-Mode] <String> [-Configuration] <String[]> [-CreateGpoDisabled] [-SkipGpoLink] [-Force]@@ -498,7 +510,7 @@ Where: - `SkipGpoLink` specifies that GPO links aren't created. - `Force` specifies that the configuration is set or GPOs are created without validating the current state. -The following example applies the full recommended Defender for Identity configuration set through Group Policy in domain mode, creates the group policy objects, and links them:+The following example applies all supported Defender for Identity domain configuration settings in one operation, creating the group policy objects and linking them: ```powershell Set-MDIConfiguration -Mode Domain -Configuration All 