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
    1. Advertisements

  2. B

    Marty List Guest

    There's several ways to do this. You should post follow-ups in this group:
    microsoft.public.windows.server.scripting

    If you want to list a single account, start with this example from the TechNet
    Script Center:
    http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true

    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
    Next
    ''''''''''''''''''''''''''''''''''''''''''''''''''''
     
    Marty List, Jul 20, 2006
    #2
    1. Advertisements

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

    http://www.joeware.net/win/free/tools/findexpacc.htm

    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
    www.joeware.net


    ---O'Reilly Active Directory Third Edition now available---

    http://www.joeware.net/win/ad3e.htm
     
    Joe Richards [MVP], Jul 20, 2006
    #4
    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.