Get AD User Password Expiration
» by JeffHicks on Wed 10 Mar 2010 · No replies
Last week I came across a post on the Microsoft Active Directory team blog about finding when a user password expires. The blog posted a PowerShell script that uses the ActiveDirectory cmdlets. The function takes a user name you pass it, get's password information and lets you know if the password has expired or when it is going to expire. It works and gets the job done. However, I decided to take it a step further.
One of my concerns with the original version is that it can't be used in the pipeline. What if you want to get password information for a group of users, but sort them by the password expiration date or only select those that will expire within a certain number of days? The existing function can't do any of that since all it does is write a string message to the pipeline. There is no object. So I revised the function to write a custom object to the pipeline that shows the user name, distinguishedname, whether the password is expired, when it will expire, if it can expire, the password age and when it was last set. Yes, I could probably write an expression using Get-ADUser to return the same results, but since the AD post was already written I decided to start with it. I always encourage people to think "object"-ively. Here's ;my version with a slightly different name.
function Get-ADUserPwdExpiration{
#requ
...continue reading "Get AD User Password Expiration"


4
195
1
4
2
37
16
45
144
611
2
3
99
1
11
1
Welcome to The Experts Community!
We've created this site so that the
general community of Active Directory administrators has a place to ask AD-related questions, as well as
questions related to identity management in general. This is also a repository of content, including
numerous papers and other resources, and links to other useful Web sites, books, and online materials.
We encourage you to participate: Create an account, subscribe to an RSS feed, ask a question, or offer
an answer. Thanks for visiting!