Azure Active Directory PowerShell for Graph
AzureAD PowerShell Modunle
You need install AzureAD module only once. In the next time, run to connect to Azure Active Directory PowerShell for Graph.
##Connect to Azure Active Directory PowerShell for Graph
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force;
Install-PackageProvider -Name NuGet -Force;
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted;
Install-Module -Name AzureAD
Connect-AzureAD
Set the password of one user to never expire
Set-AzureADUser -ObjectId chris@leoguides.info -PasswordPolicies DisablePasswordExpiration
Set the passwords of all the users in an organization to never expire
Get-AzureADUser -All $true | Set-AzureADUser -PasswordPolicies DisablePasswordExpiration
How do i know this worked
Get-AzureADUser -All $true | Select-Object UserprincipalName,@{ N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}} | Out-GridView
5/5 - (1 vote)