Link to home
Start Free TrialLog in
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....
Avatar of Brian Pierce
Brian Pierce
Flag of United Kingdom of Great Britain and Northern Ireland image

SOLUTION
Avatar of footech
footech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BPOS_guy
BPOS_guy

ASKER

Chris_Ryan81.... anyway to make that search a particular OU instead of the entire domain?