Avatar of BPOS_guy
BPOS_guy
 asked on

VB Script or DS Query or PowerShell to disable user accounts who have not logged on in 45 days

I need 2 scripts here to do the following

Need a script to search AD for user accounts that have not logged on in 45 days, disable them, and create a log for the accounts it found (c:\laslogon_disabled.txt)

Need the second script to do the same but only in an OU and not the entire domain....
VB ScriptPowershellActive Directory

Avatar of undefined
Last Comment
BPOS_guy

8/22/2022 - Mon
Brian Pierce

SOLUTION
footech

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
BPOS_guy

ASKER
Chris_Ryan81.... anyway to make that search a particular OU instead of the entire domain?
Your help has saved me hundreds of hours of internet surfing.
fblack61