diff --git a/microsoft-365/admin/add-users/set-password-to-never-expire.md b/microsoft-365/admin/add-users/set-password-to-never-expire.md index 25358dbcb9e..562aa345db9 100644 --- a/microsoft-365/admin/add-users/set-password-to-never-expire.md +++ b/microsoft-365/admin/add-users/set-password-to-never-expire.md @@ -104,7 +104,8 @@ Run one of the following commands: - To set the passwords of all the users in an organization to never expire, run the following cmdlet: ```powershell - Get-MGuser -All | Update-MgUser -PasswordPolicies DisablePasswordExpiration + $userall = Get-MGuser -All + $userall | foreach {Update-MgUser -UserId $_.Id -PasswordPolicies DisablePasswordExpiration} ``` > [!WARNING]