Get a Pentest and security assessment of your IT network.

Cyber Security

Audit SAM User Events in Windows 2012 R2

TL;DR

This guide shows you how to enable auditing for specific events related to user accounts (SAM users) in Active Directory on a Windows Server 2012 R2 domain controller. This helps track changes and potential security issues.

Auditing SAM User Events in Windows 2012 R2

  1. Open Group Policy Management
  2. On your domain controller, open Server Manager. Go to ToolsGroup Policy Management.

  3. Edit the Default Domain Controllers Policy
  4. In the Group Policy Management console, expand Forest: yourdomain.comDomains: yourdomain.com and right-click on Default Domain Controllers Policy. Select Edit.

  5. Navigate to Audit Settings
  6. In the Group Policy Management Editor, go to Computer ConfigurationWindows SettingsSecurity SettingsLocal PoliciesAudit Policy.

  7. Configure Audit Object Access
  8. Double-click on Audit object access. Configure the following:

    • Success: Check this box to audit successful accesses.
    • Failure: Check this box to audit failed accesses. This is important for detecting unauthorized attempts.
    • Click Advanced.
  9. Configure Advanced Audit Object Access Settings
  10. In the Advanced Security Settings window:

    • Click Add.
    • Enter SAM Compatible Name in the Select Principal box and click Find Now. Select the user account you want to audit (or leave it blank for all users). Click OK.
    • In the Access this object section, select All Access from the dropdown menu.
    • Under Apply auditing to, check the following event types:
      • Create: Audits when a new user account is created.
      • Delete: Audits when a user account is deleted.
      • Change permissions: Audits changes to user account permissions.
      • Set attributes: Audits changes to user account properties (e.g., password, address).
    • Click OK twice to save the settings.
  11. Configure Audit Directory Service Access
  12. Double-click on Audit directory service access. Configure the following:

    • Success: Check this box to audit successful accesses.
    • Failure: Check this box to audit failed accesses.
    • Click Advanced.
  13. Configure Advanced Audit Directory Service Access Settings
  14. In the Advanced Security Settings window:

    • Click Add.
    • Enter SAM Compatible Name in the Select Principal box and click Find Now. Select the user account you want to audit (or leave it blank for all users). Click OK.
    • Under Apply auditing to, check the following event types:
      • Read: Audits when a user’s attributes are read.
      • Write: Audits when a user’s attributes are modified.
    • Click OK twice to save the settings.
  15. Update Group Policy
  16. Open Command Prompt as an administrator and run:

    gpupdate /force

    This forces a refresh of the group policy on all domain controllers.

  17. View Audit Logs
  18. The audit logs are stored in the Security event log. Open Event Viewer (Control PanelAdministrative ToolsEvent Viewer) and navigate to Windows LogsSecurity.

    Filter the Security log by Event IDs related to object access or directory service access. Common Event IDs include:

    • 4657: A user account was created.
    • 4658: A user account was deleted.
    • 4662: User account was enabled/disabled.
    • 4663: An attempt to change an account’s attributes was made.
Related posts
Cyber Security

Zip Codes & PII: Are They Personal Data?

Cyber Security

Zero-Day Vulnerabilities: User Defence Guide

Cyber Security

Zero Knowledge Voting with Trusted Server

Cyber Security

ZeroNet: 51% Attack Risks & Mitigation