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
Get-AzureADUser -All $true |
Select-Object UserprincipalName,@{ N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}} | Out-GridView
Report of all the users in Html
Get-AzureADUser -All $true |
Select-Object UserprincipalName,@{N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}} |
ConvertTo-Html | Out-File $env:userprofile\Desktop\ReportPasswordNeverExpires.html | Start $env:userprofile\Desktop\ReportPasswordNeverExpires.html
Report of all the users in CSV
Get-AzureADUser -All $true |
Select-Object UserprincipalName,@{ N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}} |
Export-Csv $env:userprofile\Desktop\ReportPasswordNeverExpires.csv -NoTypeInformation | Start $env:userprofile\Desktop\ReportPasswordNeverExpires.csv
Disconnect-AzureAD
5/5 - (1 vote)