Advertisement
D0cEvil

PowerShell - Azure AD User check

Dec 27th, 2022
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PowerShell 0.39 KB | Cybersecurity | 0 0
  1. #Getting active accounts with "PasswordNeverExpires" from Active Directory
  2. #The output information is written to a file result.csv
  3. #The script requires the active Directory PowerShell module installed
  4.  
  5. get-aduser -filter * -properties Name, PasswordNeverExpires | where { $_.passwordNeverExpires -eq "true" } | where {$_.enabled -eq "true"} | Export-Csv C:\Result.csv -NoTypeInformation -Force
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement