Generate report out of AD showing the disabled User account(s) with disabling date

Posted on 2011-10-05
Last Modified: 2012-05-12
I need to generate report out of AD showing the disabled User account(s) with disabling date.
Can this be achieved via ADUC or do you know of a script which I can use to generate the report?
Question by:lakhvir
    LVL 57

    Accepted Solution

    Try adfind by MVP Joe Richards

    adfind -default -bit -f "&(objecategory=person)(objectclass=user)(userAccountControl:AND:=2)" -csv -tdcs samaccountname whenchanged > c:\disabledusers.csv

    There is a nice free GUI tool called adinfo that may help too

    There is no attribute for when the account is disabled.  There is a whenchanged attribute but that doesn't mean when disabled.

    LVL 25

    Expert Comment

    dsquery user DC=<domain>,DC=Com -o upn -disabled
    LVL 25

    Expert Comment

    oops - I forgot you also want when it was disabled.  I have to defer to mkline71's answer that there really isn't an attribute for that part.
    LVL 24

    Expert Comment

    You can use third party software True Last Logon 2.9.You can export the file in excel for report creation.You can use the trial version this will achieve what you are looking for.

    True Last Logon displays the following Active Directory information:
    --Users real name and logon name
    --Detailed account status
    --Last Logon Date & Time
    --Last Logon Timestamp (Replicated value)
    --Account Expiry Date & Time
    --Enabled or Disabled Account
    --Locked Accounts
    --Password Expires
    --Password Last Set Date & Time
    --Logon Count
    --Bad Password Count
    --Expiry Date
    --You can also query for any other attribute (Example: Description, telephone Number, custom attibutes etc)

    Refer the below link for trial version:
    LVL 57

    Expert Comment

    by:Mike Kline
    true last logon will tell you when the account was disabled??
    LVL 25

    Expert Comment

    Moving forward you could get a program like Active Administrator. It isn't a cheap program however it does give you a lot of functionality. It stores changes in it's own database that you can then run reports on.

    I have a scheduled report that details who made what changes during the past 24 hours. This includes anyone creating, disabling, deleting or any other changes to accounts.  It alerts myself and the compliance committee to any changes made to the Domain Admins group.

    You can check it at ScriptLogic:

    There are also many other programs out there that do similar stuff as well.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    I'm sure that every Windows systems administrator has written, or at least used, a batch or VBS login script at some point in their career, whether it is to map network drives, install printers, or set some user preferences.  No more! With Window…
    I know all systems administrator at some time or another has had to create a script to copy file from a server share to a desktop. Well now there is an easy way to do this in Group Policy. Using Group policy preferences is not hard. The first thing …
    This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
    This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now