Muokkaa

Jaa


Get-MsolPasswordPolicy

Gets the current password policy for a tenant or a domain.

Syntax

Get-MsolPasswordPolicy
   -DomainName <String>
   [-TenantId <Guid>]
   [<CommonParameters>]

Description

The Get-MsolPasswordPolicy cmdlet gets the values associated with the Password Expiry window or Password Expiry Notification window for a tenant or specified domain. If you specify a domain name, it must be a verified domain for the company.

Examples

Example 1: Get the password policy for the tenant

PS C:\> Get-MsolPasswordPolicy

This command gets the password policy for the tenant.

Example 2: Get the password policy for a domain

PS C:\> Get-MsolPasswordPolicy -DomainName contoso.com

This command gets the password policy for the domain contoso.com.

Parameters

-DomainName

Specifies the fully qualified domain name of the domain to be retrieved.

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

-TenantId

Specifies the unique ID of the tenant on which to perform the operation. The default value is the tenant of the current user. This parameter applies only to partner users.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Outputs

This cmdlet returns the following values:

  • ValidityPeriod. Specifies the length of time that a password is valid before it must be changed. A null value indicates the default value of 90 days will be used.

  • NotificationDays. Specifies the number of days before a user receives notification that their password will expire. A null value indicates the default of 14 days will be used.