How to list user's account password expire.

Discussion in 'Active Directory' started by B, Jul 20, 2006.

  1. B

    B Guest

    Hi, I would like to know how to generate the list that shows when user's
    account password expire. Is there any script? Thank you,
    B, Jul 20, 2006
    1. Advertisements

  2. B

    Marty List Guest

    There's several ways to do this. You should post follow-ups in this group:

    If you want to list a single account, start with this example from the TechNet
    Script Center:

    If you want to display all accounts, start with this script. Save it with a
    ..VBS extension and then run it from a command prompt like this:
    cscript.exe filename.vbs

    Option Explicit
    Dim objDomain, objUser, PasswordAge, PasswordExpired

    Set objDomain = GetObject("WinNT://MYDOMAIN,domain")
    objDomain.Filter = Array("User")

    Wscript.Echo "Account, PasswordAgeInDays, PasswordExpired"
    For Each objUser In objDomain
    PasswordAge = CLng(objUser.PasswordAge / 60 / 60 / 24)
    PasswordExpired = CStr(CBool(objUser.PasswordExpired))
    Wscript.Echo objUser.Name, PasswordAge, PasswordExpired
    Marty List, Jul 20, 2006
    1. Advertisements

  3. Jorge de Almeida Pinto [MVP], Jul 20, 2006
  4. Take a look at FindExpAcc on my website.

    You can tell it to show you accounts that will expire, it won't show you
    accounts not configured to expire.

    Something like this will probably be what you want

    findexpacc -days 365 -pwd

    Joe Richards Microsoft MVP Windows Server Directory Services
    Author of O'Reilly Active Directory Third Edition

    ---O'Reilly Active Directory Third Edition now available---
    Joe Richards [MVP], Jul 20, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.