Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 36188

Set Password of Azure Active Directory B2B User to Not Expire with PowerShell

$
0
0

First up, non-expiring passwords aren’t recommended… but, what if you did want to set an AAD user to have a non-expiring password? Furthermore, what if you wanted to target a B2B user?
 
Here’s how I get a list of my B2B users, that have a display name starting with Ian, that also have their password set to expire…
 


Get-AzureADuser -Filter "creationtype eq 'invitation' and startswith(displayName,'Ian')" |
Where-Object {$_.PasswordPolicies -ne "DisablePasswordExpiration"} |
Format-Table UserPrincipalName,DisplayName,CreationType,UserType,PasswordPolicies

 

capture215_a
 

Now, to use the redacted UserPrincipalName to target the user and set their password to not expire…
 


Set-AzureADuser -ObjectID //RedactedUpn// -PasswordPolicies DisablePasswordExpiration

 

clip_image100
 


Viewing all articles
Browse latest Browse all 36188

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>