Set-MsolPasswordPolicy

Updates the password policy of a specified domain.

Syntax

Set-MsolPasswordPolicy
   -DomainName <String>
   -ValidityPeriod <UInt32>
   -NotificationDays <UInt32>
   [-TenantId <Guid>]
   [<CommonParameters>]

Description

The Set-MsolPasswordPolicy cmdlet updates the password policy of a specified domain. Three settings are required, the first is the root Domain we are targeting, the second is to indicate the length of time that a password remains valid before it must be changed and the third is to indicate the number of days before the password expiration date that will trigger when users will receive their first notification that their password will soon expire.

Examples

Example 1: Update validity period and notification for a domain

PS C:\> Set-MsolPasswordPolicy -ValidityPeriod 60 -NotificationDays 14 -DomainName "contoso.com"

This command updates the policy on the domain contoso.com so that users passwords expire after 60 days. The users receive notification 14 days prior to that expiry.

Parameters

-DomainName

Specifies the fully qualified domain name to which to apply policies.

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

-NotificationDays

Specifies the number of days before the password expiration date that triggers when users receive their first notification that their password will soon expire.

Type:UInt32
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

-ValidityPeriod

Specifies the length of time that a password is valid before it must be changed.

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