Office365: Set account passwords to never expire

$ Install-Module MSOnline
$ Connect-MSOLService

To list all users and see if their password expires, use this cmdlet:

$ Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires

Check password settings
To check the PasswordNeverExpires for just one user, use this cmdlet, replacing alias with the user's alias.

$ Get-MSOLUser -UserPrincipalName alias | Select PasswordNeverExpires

To change a single user, use the following command, replacing alias with the user's alias.

$ Set-MsolUser -UserPrincipalName alias -PasswordNeverExpires $true

To change the passwords to expire, run the cmdlet above but use $false instead of $true.