How to view, set, and manage the maxPwdAge attribute in Active Directory

Last updated on:

The maxPwdAge attribute is a built-in domain-level attribute in Active Directory (AD) that controls the default maximum password age for all user accounts in a domain. The value specifies how long, in 100-nanosecond intervals, a password remains valid before the user is required to change it. It is stored on the domain object itself, not on individual user objects, and applies domain-wide unless overridden by a fine-grained password policy.

This article covers what maxPwdAge is, where it lives in the schema, and how to manage it using three approaches: Group Policy Management Console (GPMC), PowerShell, and ADManager Plus.

maxPwdAge attribute at a glance

LDAP display name maxPwdAge
CN Max-Pwd-Age
Syntax Interval (Large Integer, stored as a negative value in 100-nanosecond intervals; 0 is stored as the minimum Int64 to disable expiration)
OM-Syntax 65
Attribute ID (OID) 1.2.840.113556.1.4.74
System ID GUID bf9679bb-0de6-11d0-a285-00aa003049e2
Single- or multi-valued Single-valued
Indexed No
In Global Catalog No
Replicated Yes, to all domain controllers in the domain
Visible in default ADUC UI No, managed via Group Policy or Active Directory Service Interfaces Editor (ADSI Edit) on the domain object
Applies to Windows 2000 Server and later (Domain-Policy, Sam-Domain, Sam-Domain-Base classes)
Source schema Microsoft core AD schema
Microsoft reference Win32 ADSchema ยท Set-ADDefaultDomainPasswordPolicy

Note: The value of maxPwdAge is stored as a negative Int64 (large integer) in the directory and expressed in 100-nanosecond intervals. A value of zero disables password expiration for the domain. PowerShell cmdlets and GPMC display the value in days, which is the expected input format for most management workflows. Reading the raw attribute value via ADSI Edit or LDAP tools will return a large negative number; this is correct behavior.

What maxPwdAge is used for

maxPwdAge was introduced as part of the core Microsoft AD schema to enforce periodic password rotation across a domain. Every domain that runs Active Directory Domain Services (AD DS) has this attribute set on the domain object. When the attribute is configured, AD calculates each user's password expiration date by adding the maxPwdAge value to the pwdLastSet timestamp on the user's account.

Common uses of this attribute include:

  • Enforcing periodic password rotation across all domain user accounts as a baseline security control.
  • Supporting compliance requirements such as the PCI DSS, HIPAA, NIST 800-63B, and ISO 27001 that mandate password change intervals.
  • Setting a domain-wide default that applies to any user not covered by a fine-grained password policy.
  • Establishing a known expiration baseline for service accounts that are not managed by a dedicated privileged access solution.

When to use maxPwdAge vs. fine-grained password policies

maxPwdAge is the right tool when a single expiration rule covers the entire domain. It requires no additional AD objects and applies automatically to every account not targeted by a Password Settings Object (PSO).

Fine-grained password policies are the right tool when different populations need different rules. Each fine-grained password policy is stored as a PSO under CN=Password Settings Container,CN=System,DC=.... The PSO contains its own msDS-MaximumPasswordAge value and is linked to a security group or individual account. Common scenarios include shorter cycles for privileged accounts (30-60 days), longer windows for service accounts (180-365 days), or stricter expiration for users with access to regulated systems.

When multiple PSOs apply to the same user, AD resolves the conflict using msDS-PasswordSettingsPrecedence, through which the PSO with the lowest precedence value wins. A PSO applied directly to a user always beats a group-linked PSO regardless of precedence.

maxPwdAge remains the fallback for any account not covered by a PSO. To achieve consistent password expiration across the domain while accommodating exceptions, set maxPwdAge to the baseline for the majority, then use PSOs to tighten or relax it for specific groups. To confirm which policy applies to a given account, run:

powershellGet-ADUserResultantPasswordPolicy -Identity jsmith

If no PSO applies, the cmdlet returns nothing and maxPwdAge is in effect. Fine-grained password policies require a Windows Server 2008 domain functional level or higher.

  • ADUC
  • PowerShell
  • ADManager Plus
  • Troubleshooting
  • FAQ
 

How to manage maxPwdAge using Group Policy

maxPwdAge is a domain-level attribute on the domain object (Sam-Domain). The standard management path is the Group Policy Management Console (GPMC), which exposes the value as the Maximum password age setting in the Default Domain Policy. ADUC itself does not surface this attribute. Direct editing via ADSI Edit is also possible but is not recommended for routine management.

Set maximum password age via the GPMC

  1. Open the Group Policy Management Console (gpmc.msc).
  2. Expand the domain node. Right-click Default Domain Policy and select Edit.
  3. Navigate to Computer Configuration > Policies > Windows Settings > Security Settings > Account Policies > Password Policy.
  4. Double-click Maximum password age. Enter the number of days (1 to 999) or enter 0 to disable expiration.
  5. Click OK.

After replication, domain controllers apply the updated domain password policy.

Note: Changes to password policy in the Default Domain Policy propagate to domain controllers during the next replication cycle. You can force immediate application on a DC with gpupdate /force.

Limitations of the GPMC

  • Domain-wide scope only: The Default Domain Policy setting applies to all user accounts not covered by a fine-grained password policy. You cannot scope it to an OU or security group from this interface.
  • No per-user override: To exempt individual accounts or groups from the domain-wide policy, use fine-grained password policies (PSOs), not the Default Domain Policy.
  • Requires domain admin rights: Only members of Domain Admins or those delegated Group Policy edit rights can modify the Default Domain Policy.

How to manage maxPwdAge using PowerShell

The AD PowerShell module provides Get-ADDefaultDomainPasswordPolicy and Set-ADDefaultDomainPasswordPolicy as the primary cmdlets for reading and writing maxPwdAge. These cmdlets translate the raw 100-nanosecond interval value to and from a human-readable TimeSpan format. You can also read the raw attribute value via Get-ADObject if you need the underlying integer.

Read the current maximum password age

Get-ADDefaultDomainPasswordPolicy -Identity internal.com | Select-Object MaxPasswordAge

This cmdlet returns the MaxPasswordAge value for the specified domain as a TimeSpan object (days, hours, minutes).

To read the raw attribute value from the domain object:

Get-ADObject -SearchBase (Get-ADDomain).DistinguishedName \
-SearchScope Base -Filter * -Properties maxPwdAge |
Select-Object maxPwdAge

This returns the raw large integer value stored in the directory (a negative number expressed in 100-nanosecond intervals).

Set the maximum password age

Set-ADDefaultDomainPasswordPolicy -Identity internal.com -MaxPasswordAge 90.00:00:00

This cmdlet sets the maximum password age to 90 days for the domain. The TimeSpan format is days.hours:minutes:seconds.

To disable password expiration domain-wide:

Set-ADDefaultDomainPasswordPolicy -Identity internal.com -MaxPasswordAge 0

This sets maxPwdAge to zero, which disables password expiration. AD stores this as the minimum Int64 value (-9223372036854775808).

Read the effective password policy for a user

Get-ADUserResultantPasswordPolicy -Identity jsmith

This cmdlet returns the effective password policy applied to the specified user, accounting for both domain-wide and fine-grained policies. Requires the AD module.

Report the maximum password age across all domains in a forest

(Get-ADForest).Domains | ForEach-Object {
$pol = Get-ADDefaultDomainPasswordPolicy -Identity $_
[PSCustomObject]@{
Domain = $_
MaxPasswordAge = $pol.MaxPasswordAge
}
} | Export-Csv .\domain-pwd-policy-report.csv -NoTypeInformation

This cmdlet iterates over every domain in the forest, retrieves the default domain password policy, and exports MaxPasswordAge values to a CSV file.

Common PowerShell errors

  • The term Get-ADDefaultDomainPasswordPolicy is not recognized: The AD module is not loaded. Run Import-Module ActiveDirectory or install RSAT.
  • Access is denied: The account running the cmdlet does not have Domain Admin rights or equivalent delegated permissions on the domain object.
  • MaxPasswordAge appears as 00:00:00 in GPMC after setting via PowerShell: The GPMC reads the Default Domain Policy GPO from SYSVOL, not the raw domain-object attribute. To keep both values aligned, configure the setting in GPMC. Otherwise, rely on the domain-object attribute as the effective value and treat the GPMC display as informational only.

Limitations of PowerShell

  • Domain-wide scope: Set-ADDefaultDomainPasswordPolicy sets the attribute on the domain object, which applies to all users not subject to a fine-grained policy. Per-user or per-group scoping requires PSOs.
  • Requires the AD module: The ActiveDirectory module must be available, either via RSAT or a domain controller session.
  • No built-in rollback: There is no undo. Read the current value before making changes and document it before applying modifications.
  • TimeSpan precision: PowerShell rounds to whole days when displaying values. Use Get-ADObject with the raw attribute if you need to verify the exact 100-nanosecond interval stored in the directory.

How to manage maxPwdAge using ADManager Plus

ADManager Plus surfaces maxPwdAge through its password policy management workflows. You can view and modify the domain-wide maximum password age, report on password expiration status, and delegate password-related tasks to help desk operators without granting Domain Admin rights.

View the current maximum password age

  1. Log in to ADManager Plus.
  2. Navigate to Reports > Other Reports > Password Policy.
  3. The report displays the current Maximum Password Age setting alongside other domain password policy attributes.
Viewing the current maximum password age using the Password Policy report in ADManager Plus.

Report on password expiration status

ADManager Plus provides prebuilt reports that use the domain maxPwdAge value to calculate expiration status for all users.

  1. Navigate to Reports > Password Reports.
  2. Select one of the following reports:
    • Password Expired Users: Lists all accounts whose passwords have already expired based on pwdLastSet and maxPwdAge.
    • Soon-to-expire User Passwords: Lists users whose passwords will expire within a configurable window (for example, the next seven or 14 days).
    • Users with Password Never Expires: Lists accounts where the DONT_EXPIRE_PASSWORD flag is set in userAccountControl, overriding maxPwdAge.
  3. Apply filters by OU, group, or department as needed. Export in CSV, PDF, HTML, or XLSX format. You can also schedule automated delivery of these reports.

Bulk reset passwords for expiring accounts

  1. Run the Soon-to-expire User Passwords report.
  2. Select the accounts you want to act on and click Reset Password from the Action drop-down.
  3. Configure the required options, such as resetting the password to the logon name or a custom value and forcing users to change the password at next logon, then click Apply.
Resetting passwords for multiple users in bulk using ADManager Plus.

Delegate password management tasks to non-admins

To allow a help desk operator to run password expiration reports and reset passwords within a defined OU, without granting Domain Admin rights, use help desk delegation:

  1. Navigate to Delegation > Help Desk Roles and click + Create New Role.
  2. Enter a Role Name and Description.
  3. Select the appropriate password management tasks, for example, select the AD Reports tab > Password Reports > Soon-to-expire User Passwords report.
  4. Save the role and assign it to the operator's account, scoped to the relevant OU.
Delegating password management tasks to non-admin users using ADManager Plus.

The delegated operator can run password-related reports and reset passwords for accounts in their assigned scope.

Automate password expiration notifications

  1. Go to the Automation tab and click + Create New Automation.
  2. Enter the automation name and description, select User Automation as the category, and choose your domain.
  3. Under Tasks to automate, select Send Notification and choose the required notification template.
  4. Under Select objects, choose the Soon-to-expire User Passwords report and set the time period, such as Next 7 Days.
  5. Set the execution time, then click Save.

ADManager Plus will use the domain maxPwdAge and each user's pwdLastSet value to calculate upcoming expirations and dispatch notifications automatically.

Security and access considerations

By default, maxPwdAge on the domain object is readable by all authenticated users in the domain. This is expected behavior: Any domain member can query the domain password policy, and this visibility is required for applications that need to calculate password expiration dates. The value itself does not expose sensitive credential data.

  • Restricting write access: Only members of Domain Admins (or Enterprise Admins in a forest-root domain) can modify maxPwdAge by default. Delegating write access to this attribute requires editing the ACL on the domain object, either through Delegate Control in ADUC or directly via ADSI Edit. Exercise caution: Write access to domain-level attributes is highly privileged.
  • Auditing changes: Changes to maxPwdAge do not generate a detailed audit event by default unless Directory Service Changes auditing is enabled via Group Policy (Computer Configuration > Policies > Windows Settings > Security Settings > Advanced Audit Policy Configuration > DS Access > Audit Directory Service Changes). Enable this to capture who modified the attribute and when.
  • Fine-grained password policies as an alternative: If different user populations require different maximum password ages, use fine-grained password policies (PSOs). PSOs can be scoped to specific groups or users, avoiding any need to change the domain-wide maxPwdAge value.
  • Read access warning: Avoid changing default read permissions on the domain object unless you have validated the impact in a non-production environment. Applications and scripts often rely on reading the domain password policy.

Troubleshooting

Passwords are not expiring even though maxPwdAge is set to 90 days.

Check the DONT_EXPIRE_PASSWORD flag in each affected user's userAccountControl attribute. This flag, when set, overrides maxPwdAge for that individual account. Run Search-ADAccount -PasswordNeverExpires to list all affected accounts.

maxPwdAge shows 42 days in PowerShell but GPMC shows 0 (no expiration).

This discrepancy usually indicates that the Default Domain Policy has a blank or undefined Maximum Password Age setting. While the domain object's maxPwdAge attribute was set directly (for example, via ADSI Edit or an older management tool), GPMC reads the GPO, not the raw attribute. Use Set-ADDefaultDomainPasswordPolicy to align the domain object attribute, then confirm the value in GPMC by checking Effective Policy in the domain controller's local security policy.

After running Set-ADDefaultDomainPasswordPolicy, users still see the old expiration date.

Password expiration is calculated from the user's pwdLastSet value and the domain's maxPwdAge. If you change maxPwdAge, the computed expiration date for existing accounts can change immediately. For example, reducing the maximum password age can cause accounts with older passwords to expire sooner. If users still appear to have the old value, verify replication and confirm the effective password policy being applied.

Get-ADDefaultDomainPasswordPolicy returns MaxPasswordAge as 00:00:00.

This means maxPwdAge is set to zero in the directory (passwords never expire). If this is not the intended state, set the value using Set-ADDefaultDomainPasswordPolicy -MaxPasswordAge 90.00:00:00 and verify the change with Get-ADDefaultDomainPasswordPolicy.

The domain shows the correct maxPwdAge value but fine-grained policy users aren't affected.

Fine-grained password policies (PSOs) take precedence over maxPwdAge for the users and groups they are applied to. A PSO-assigned user's effective maximum password age comes from the PSO's msDS-MaximumPasswordAge attribute, not from the domain maxPwdAge. Use Get-ADUserResultantPasswordPolicy -Identity <username> to confirm which policy is actually in effect for a specific user.

  • minPwdAge: Sets the minimum number of days a user must keep a password before changing it. Often configured alongside maxPwdAge to prevent rapid cycling through the password history.
  • minPwdLength: Specifies the minimum character length for domain passwords. Part of the same domain password policy cluster as maxPwdAge.
  • pwdHistoryLength: Controls how many previous password hashes AD retains to prevent reuse. This works in conjunction with maxPwdAge to enforce meaningful rotation.
  • lockoutDuration: Defines how long an account remains locked after exceeding the bad-password threshold. A related account-policy attribute managed through the same Default Domain Policy interface.
  • pwdLastSet: Records the timestamp when a user's password was last set. AD uses this value together with maxPwdAge to calculate when a password expires.

Manage maxPwdAge and every other AD attribute from one console

ADManager Plus gives you centralized control over domain password policies, password expiration reporting, and account life cycle workflows, without requiring Domain Admin rights for every task. You can view, update, and report on maxPwdAge and related policy attributes, delegate password resets to help desk staff, and automate expiration notifications, all from a single web-based console.

Frequently asked questions

The default value is 42 days, which is expressed internally as a large negative integer. This default is set when a new AD domain is provisioned. Many organizations modify it to 60, 90, or 180 days, or disable expiration entirely depending on their security requirements.

The attribute is stored on the domain object at the root of the domain naming context (for example, DC=internal,DC=com). It is not stored on individual user objects. To view it directly, open ADSI Edit, connect to the domain naming context, and open the properties of the root domain object.

No, when the DONT_EXPIRE_PASSWORD flag is set in a user's userAccountControl attribute, that individual account ignores maxPwdAge entirely. The per-account flag takes precedence over the domain policy.

Setting the value to zero disables password expiration for the entire domain. AD stores this as the minimum Int64 value. All users whose passwords would otherwise expire are no longer forced to change their passwords unless a fine-grained password policy is in effect for their accounts.

Fine-grained password policies (PSOs) take precedence over the domain maxPwdAge for any user or group they are directly or indirectly applied to. The domain maxPwdAge acts as the fallback for all accounts not covered by a PSO. Use Get-ADUserResultantPasswordPolicy to determine the effective policy for a specific account.

No, domain-level password policy attributes apply to the entire domain, not to OUs. To apply different maximum password age values to different user populations (per group or per user), create fine-grained password policies with the desired msDS-MaximumPasswordAge values and link them to the target groups or users.

No, maxPwdAge is a domain object attribute and is not synced to Microsoft Entra ID as part of standard Microsoft Entra Connect synchronization. Password expiration policies in Entra ID are configured separately through the Entra ID Password Protection and Password Policies settings in the Microsoft Entra admin center.

Manage maxPwdAge and any AD attribute at scale with ADManager Plus

The one-stop solution to Active Directory Management and Reporting
Email Download Link Email the ADManager Plus download link