Get-EntraPasswordPolicy

Retrieves the current password policy for the tenant or the specified domain.

Syntax

Get-EntraPasswordPolicy 
 []
Get-EntraPasswordPolicy
    -DomainName <String> 
   [<CommonParameters>]

Description

The Get-EntraPasswordPolicy cmdlet can be used to retrieve the values associated with the Password Expiry window or Password Expiry Notification window for a tenant or specified domain.

When a domain name is specified, it must be a verified domain for the company.

The work or school account needs to belong to one of the following Microsoft Entra roles:

  • Domain Name Administrator

Examples

Example 1: Get password policy for a specified domain

Connect-Entra -Scopes 'Domain.Read.All'
Get-EntraPasswordPolicy -DomainName 'contoso.com'

NotificationDays ValidityPeriod
---------------- --------------
            90             180

Returns the password policy for the specified domain.

  • -DomainName parameter specifies the fully qualified domain name to retrieve.

Parameters

-DomainName

The fully qualified name of the domain to be retrieved.

Type:System.String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False