Disable all Active Directory users in a domain or a specified OU that have not logged on and were not created within X days and save the list to a csv file
-
Clone this script from github or copy the files manually to your prefered directory.
-
Edit the ps1 file and replace the following values:
- $LogFolder = "C:\Disable-Inactive-AD-Users"
- $OU = "OU=MyUsers,DC=domain,DC=com"
$UnusedDays = 365
Author: RaveMaker.