Written by 8:48 pm Microsoft, Microsoft Azure, Office 365, PowerShell, Windows Server

Change Office 365 password expiration policy

Import MSOnline PowerShell Module

Well if you are using Office 365 and you may have the need to change the password expiration policy for some accounts. (Important: This is not recommended, in my opinion password changes are even more important when using cloud services.)

To change the password expiration policy for an user on Office 365 you have to to this with Windows PowerShell.

To manage Windows Azure Active Directory with PowerShell, where also your Office 365 users are stored, you have to do some simple steps.

First make sure you have installed the .NET Framework 3.5 on your management machine.

<br />
Enable-WindowsOptionalFeature -FeatureName NetFx3<br />

Install Microsoft Online Services Sign-in Assistant: Install the appropriate version of the Microsoft Online Services Sign-in Assistant for your operating system from the Microsoft Download Center. Microsoft Online Services Sign-In Assistant for IT Professionals RTW.

Install Windows Azure AD Module for Windows PowerShell: Install the appropriate version of the Windows Azure AD Module for Windows PowerShell for your operating system from the Microsoft Download Center:

Import the MSOnline Windows PowerShell module

<br />
Import-Module MSOnline<br />

Import MSOnline PowerShell Module

Connect to your Windows Azure Active Directory Tenant or your Office 365 Tenant:

<br />
Connect-MsolService<br />

This will open a popup windows where you have to enter your credentials.

Now now you can start working with your Windows Azure Active Directory.

Connect Windows Azure AD via PowerShell

And you can now finally change the password expiration policy to never.

<br />
PS C:\Users\Thomas\Desktop&gt; Get-MsolUser -UserPrincipalName user@domain.com | Set-MsolUser -PasswordNeverExpires $true<br />

Tags: , , , , , , , , , Last modified: November 19, 2013
Close Search Window
Close