Auditing: Report and Disable Inactive AD User Accounts

The below can be run as a scheduled task to detect and disable accounts that have not been used for a specified amount of days or for accounts which have never been used.

Report outputs to a CSV and is displayed as follows:


  1. Reply
    Dave April 16, 2018

    You should drop your code into a textbox or something that maintains spacing. Copying + pasting what you have above doesn’t paste properly, causing syntax errors.

    • Reply
      Michael April 16, 2018

      Hi Dave,

      Thanks for this . Will look to reformat later in the week. Meanwhile if you would like me to send a working copy then let me know

  2. Reply
    Jromero April 25, 2018

    Hey Michael, thanks for this share. Would you be able to send me a working copy? Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: