Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #MS Azure - Password never expires
- Connect-AzureAD
- # For single user
- Get-AzureADUser -ObjectId userUPN@contoso.com | Select-Object UserprincipalName,@{
- N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}
- }
- # For all users
- Get-AzureADUser -All $true | Select-Object UserprincipalName,@{
- N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}
- }
- # For all users, log to html
- Get-AzureADUser -All $true | Select-Object UserprincipalName,@{
- N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}
- } | ConvertTo-Html | Out-File $env:userprofile\Desktop\ReportPasswordNeverExpires.html
- # For all users, Log to csv
- Get-AzureADUser -All $true | Select-Object UserprincipalName,@{
- N="PasswordNeverExpires";E={$_.PasswordPolicies -contains "DisablePasswordExpiration"}
- } | ConvertTo-Csv -NoTypeInformation | Out-File $env:userprofile\Desktop\ReportPasswordNeverExpires.csv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement