In order to do this you need be running Windows 7 OR Server 2008R2 or above.
Follow the requirements for the Microsoft Online Services Module
The following are required in order to run the Microsoft Online Services Module:
- Operating system: Use Windows 7 or Windows Server 2008 R2.
- Microsoft .NET Framework: You must turn on the Microsoft .NET Framework 3.51 feature in Windows 7 or Windows Server 2008 R2.
- Windows PowerShell 2.0 and AD FS 2.0: In order to run the cmdlets to set up single sign-on, you must turn on the Windows PowerShell 2.0 feature, and you must have administrator privileges on the AD FS 2.0 server. We recommend that you use remote access to the AD FS 2.0 server when you run the cmdlets; to do this you must use Windows PowerShell remoting. For information, see About_Remote_Requirements.
- All Office 365 software updates: From the Office 365 downloads page, install the required updates. To access the Office 365 downloads page, sign in to the Office 365 portal, and, under Resources, click Downloads. These updates are required because the features in Office 365 will not work properly without the appropriate versions of operating systems, browsers, and software. For more information, see Set up your desktop for Office 365.
To Activate the Power Shell 2.0 feature
The Microsoft Online Services Module for Windows PowerShell is a download that comes with Office 365. This module installs a set of cmdlets to Windows PowerShell; you run those cmdlets to set up single sign-on for Office 365.
First Start Windows Power Shell Then issue these commands:
To set the password of one user to never expire, run the following cmdlet by using the user principal name (UPN) or the user ID of the user:
Set-MsolUser -UserPrincipalName <user ID> -PasswordNeverExpires $true
Where you replace <user ID> with the full name of the user you want the password not to expire.
For example "email@example.com"
- To set the passwords of all the users in an organization to never expire, run the following cmdlet:
Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true
To check if the password is set to never expire:
- To see whether a single user’s password is set to never expire, run the following cmdlet by using the user principal name (UPN) (for example, firstname.lastname@example.org) or the user ID of the user you want to check:
Get-MSOLUser -UserPrincipalName <user ID> | Select PasswordNeverExpires
- To see the "Password never expires" setting for all users, run the following cmdlet:
Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires