Disable inactive users and create task scheduler to run everyday (Powershell)

Due to there is no group policy for disable inactive user, i wrote this script and share it with you.This script will disable user accounts that didn't login for specific time (90 days) and move them to specific OU. It creates a task scheduler and will run every day to find new i

5 Star
685 times
Add to favorites
Active Directory
E-mail Twitter del.icio.us Digg Facebook
  • how can i run this script on my AD
    2 Posts | Last post May 13, 2019
    • how can i run this script on my AD, and what are the changes that i need to do to the script.
    • Hi,
      all you have to do is create an OU on your active directory to hold disable account and then add it to the second variable $OUPath. then run the script as administrator
      it asks for a valid user account to run task scheduler. provide a user account that has sufficient access to active directory and its object (like domain admin)