From 45037841246b83a2d95b82c9a48f4e4fdc1a2815 Mon Sep 17 00:00:00 2001 From: Sriraman M S <45987684+msbemba@users.noreply.github.com> Date: Tue, 14 Nov 2023 18:21:06 +0530 Subject: [PATCH] Update set-password-to-never-expire.md Fixed Set a password to never expire example for all users Fixes https://github.com/MicrosoftDocs/microsoft-365-docs/issues/13074 --- microsoft-365/admin/add-users/set-password-to-never-expire.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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]