Difference between revisions of "AzureAD Set User Password Expiration"

From DFWLPiki
Jump to: navigation, search
(Created page with " Get-AzureADUser -ObjectId UPN | Select-Object UserprincipalName,@{N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}} Set-AzureADUser -O...")
 
 
Line 1: Line 1:
 +
[[Category:Azure]]
 
  Get-AzureADUser -ObjectId UPN | Select-Object UserprincipalName,@{N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}}
 
  Get-AzureADUser -ObjectId UPN | Select-Object UserprincipalName,@{N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}}
  
 
  Set-AzureADUser -ObjectId UPN -PasswordPolicies DisablePasswordExpiration
 
  Set-AzureADUser -ObjectId UPN -PasswordPolicies DisablePasswordExpiration

Latest revision as of 17:38, 6 January 2022

Get-AzureADUser -ObjectId UPN | Select-Object UserprincipalName,@{N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}}
Set-AzureADUser -ObjectId UPN -PasswordPolicies DisablePasswordExpiration