Skip to content

Commit 4503784

Browse files
authored
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
1 parent 0ff260a commit 4503784

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

microsoft-365/admin/add-users/set-password-to-never-expire.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ Run one of the following commands:
104104
- To set the passwords of all the users in an organization to never expire, run the following cmdlet:
105105
106106
```powershell
107-
Get-MGuser -All | Update-MgUser -PasswordPolicies DisablePasswordExpiration
107+
$userall = Get-MGuser -All
108+
$userall | foreach {Update-MgUser -UserId $_.Id -PasswordPolicies DisablePasswordExpiration}
108109
```
109110
110111
> [!WARNING]

0 commit comments

Comments
 (0)