---
title: Managing Passwords with PowerShell
description: In Office 365, PowerShell enables many options to manage your users, mailboxes and domains. One option is to set a password for an account to never expire.
---

[Vorsite Cloud Services ](https://blog.vorsite.com)

# [Managing Passwords with PowerShell](https://blog.vorsite.com/2012/07/20/managing-passwords-with-powershell)

 Written by [cloudservicesforbusiness](https://blog.vorsite.com/author/cloudservicesforbusiness) | July 20, 2012

In Office 365, PowerShell enables many options to manage your users, their mailboxes and domain settings. One of those options is to set a password for an account to never expire. This does not restrict a user from changing their own password, but simply removes the policy that forces a user to change their password. Here’s some examples of PowerShell commands used to manage passwords:

## Password Management PowerShell

Set a password to never expire:  
**Set-MsolUser -UserPrincipalName -PasswordNeverExpires $true**

If you want to see if a password is set to never expire then run this:  
**Get-MSOLUser -UserPrincipalName | Select PasswordNeverExpires**

Another option is to set all users passwords to never expire, to accomplish this run the following:  
**Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true**

This is how to manually configure the password for an account and force them to change it at next log on:  
**Set-MsolUserPassword -userPrincipalName -NewPassword ‘password’ -ForceChangePassword $true**

These are a sampling of the commands, to see more type ‘Get-Help Set-MsolUserPassword’ in PowerShell or get-help before any other command to see what’s available.

[View full post](https://blog.vorsite.com/2012/07/20/managing-passwords-with-powershell)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "cloudservicesforbusiness"
  },
  "dateModified" : "2017-08-17T21:26:53.043Z",
  "datePublished" : "2012-07-20T21:30:07Z",
  "headline" : "Managing Passwords with PowerShell",
  "image" : {
    "@type" : "ImageObject",
    "height" : 60,
    "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
    "width" : 60
  },
  "mainEntityOfPage" : "https://blog.vorsite.com/2012/07/20/managing-passwords-with-powershell",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60,
      "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
      "width" : 60
    },
    "name" : "Vorsite Blog"
  }
}
```