Developed a powershell script to report and disable inactive users in domain. This script will identify users inactive for last 60 days in domain. This script have two options; you can just pull out list of inactive users report and the second option is to disable the inactive users and while disabling it will add description to those accounts. Also it will generate an email alert to specified recepients with list of users as attachment.
Followings lines on the script to be changed according to your requirement
$searchRoot = “test.com/” -> Change the domain name instead of test.com
$inactiveDays = 60 -> If you want change number of days to identify inactive users
$toAddr = @(“firstname.lastname@example.org”,”email@example.com”) -> Change the email addresses to whom the alert to be sent.
$smtpsrv = “smtp.test.com” -> Update your SMTP server name or IP address
Steps to execute the script:
Install Quest Active directory powershell module on the system you are executing…
View original post 375 more words