Announcement

Collapse
No announcement yet.

Need a script to find the account expire dates for alll users

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need a script to find the account expire dates for alll users

    Hi I would need a script for listing the users with their account expiration dates
    If possible tell me how to export the results to excel too

    thanks
    Sidhin

  • #2
    Re: Need a script to find the account expire dates for alll users

    If this is a one-off task, how about using a 1-liner cmd prompt instruction:

    'dsquery user -o dn -limit 0 -uco | dsget user -display -acctexpires >> C:\UserList.txt' (all on one line, omit the single quotes).

    Granted it's only a text file, but that's simple to import into Excel. It returns all the users in your AD structure by Display Name and acct Expiration. For a recurring job, search for Powershell scripts, it can all be done directly to a CSV file in one line.
    *RicklesP*
    MSCA (2003/XP), Security+, CCNA

    ** Remember: credit where credit is due, and reputation points as appropriate **

    Comment

    Working...
    X