How to get the password age using PowerShell
PowerShell cmdlets help admins perform tasks that are beyond the scope of what can be achieved using the graphical user interface (GUI). However, using PowerShell can often be complex and time-consuming.
Consider checking for password age. Admins may want to find passwords that are nearing their expiry so they can send the respective users an email request to change their passwords. This can be achieved using PowerShell or with a tool such as ManageEngine ADSelfService Plus.
ADSelfService Plus, an identity security solution, provides several crucial reports and functions that enhance and often surpass what can be achieved via PowerShell.
Let's compare what it's like to get the password age using PowerShell vs. ADSelfService Plus.
PowerShell
Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} –Properties "DisplayName", "msDS-UserPasswordExpiryTimeComputed" | Select-Object -Property "Displayname",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}
Screenshot:
ADSelfService Plus
- Log in to ADSelfService Plus as an administrator.
- Navigate to the Reports tab > Active Directory Reports > Soon-To-Expire Password Users Report.
- Specify the domain using the Select Domain option.
- Use the Select OUs option to specify OUs if necessary.
- Use the User Passwords that will expire option to specify the number of days remaining until expiration.
- Use the Exclude Users option to exclude disabled users and smart card users from the report.
- Click Generate to generate the report.
Screenshot:
- Quick configuration
Generate password expiration dates for domain users with just a few clicks using the user-friendly interface.
- Enhanced readability
Unlike PowerShell reports that display only the usernames and password expiration dates, ADSelfService Plus provides additional information in an easy-to-read, exportable format.
- Refined reports using the GUI
Generate refined reports that provide usable data without clutter, unlike PowerShell scripts that display complex data.
- Password expiration notifications
Proactively notify users about impending password expirations through email, SMS, and push notifications, enabling them to change their passwords before expiration.
- Comprehensive user information report
ADSelfService Plus offers various reports that provide information about locked-out domain users and their password expiration statuses.
- Automated email notification
Schedule and automate the generation of reports, which can be emailed directly to administrators and managers at specified intervals.
- Automatic password resets
Enable the automatic password resets for expired passwords, ensuring they are regularly updated without manual intervention.
- Export and search options
Export reports in multiple formats, including CSV, CSV, HTML, and PDF. Use the built-in search option to locate specific entries in reports quickly.
Related Resources
- Password Expiry Email Notification using powershell
- Account Expiry Notification using Powershell Script
- How to unlock active directory user account using Powershell Script?
- How to sync active directory password with Office 365 using Powershell
- How to blacklist weak Active Directory passwords
- Self-service Active Directory Password Reset with Powershell
- Powershell Script to Reset User's Password in Google Apps
- How to audit Active Directory Password Quality using Powershell
- Office 365 Password Policy with PowerShell
- How to change user password at first logon using Powershell Script
- How to reset an Azure Active Directory User Password using Powershell
- How to automate Password Reset with Powershell Command
- How to automate unlock with powershell
- How to Get Password Age with Powershell
- How to change Local User Password Remotely using PowerShell script
- How to identify Active Directory Users with Pwned Passwords using Powershell?
- How to self-update active directory details using Powershell
- Powershell password security best practices
- How to enforce password policy for AD user using powershell
- How to get fine-grained password policy using Powershell
- How to sync password between ad domains using Powershell?
- How to find bad password attempts in Active Directory using PowerShell