Get-EntraPasswordPolicy
Retrieves the current password policy for the tenant or the specified domain.
Syntax
GetQuery (Default)
Get-EntraPasswordPolicy
[<CommonParameters>]
GetById
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.
In delegated scenarios, the signed-in user must have either a supported Microsoft Entra role or a custom role with the necessary permissions. The minimum roles required for this operation are:
- 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.
Parameter properties
Type: | System.String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
GetById
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.