Updated: July 30, 2015
Applies To: Azure, Office 365, Windows Intune
Sets the values associated with the password notification window and password validity window for a specified domain or all domains in the tenant.
Set-MsolPasswordPolicy -DomainName <string> -NotificationDays <int> -ValidityPeriod <int> [<CommonParameters>]
The Set-MsolPasswordPolicy cmdlet can be used to update the password policy of a specified domain or tenant.
Three settings are required:
-- The DomainName parameter specifies the fully-qualified domain name for which to apply policies.
-- The NotificationDays parameter is a value from 1 to 30 that that indicates the length of time that a password remains valid before it must be changed.
-- The ValidityPeriod parameter is a value from 14 to 730 that indicates 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.
-DomainName <string> The fully qualified domain to apply policies to. Required? true Position? named Default value Accept pipeline input? true (ByPropertyName) Accept wildcard characters? false -NotificationDays <int> Specifies 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. This value must from be 1 to 30. Required? true Position? named Default value Accept pipeline input? false Accept wildcard characters? false -ValidityPeriod <int> Specifies the length of time that a password is valid before it must be changed. This value must be from 14 to 730. Required? true Position? named Default value Accept pipeline input? false Accept wildcard characters? false <CommonParameters> This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
The following examples demonstrate the usage of the cmdlet.
Example 1: Update the policy on a specified domain
The following command updates the policy on the domain contoso.com so that user passwords will expire after 60 days and that the users will receive notification of 14 days prior to that expiry. The DomainName parameter is required.
Set-MsolPasswordPolicy DomainName -"contoso.com" -NotificationDays 14 -ValidityPeriod 60
There are several other places you can get more information and help. These include: