Cleanup Inactive AD Accounts w/ PowerShell Pt 1: New-Timespan, Search-ADAccount, Disable-ADAccount

Welcome back to PowerShell Breakdown. This script that I'm showing in this video disables inactive (stale) computers in Active Directory. To be more specific, it disables all of the computers in an Organization Unit that have not had any users logon to them in the past 45 days. I'm using computers in this script, but everything shown is applicable for user accounts as well. I'll start by typing the three main steps of the script to map out the logical p...
repotechsstarsweeklyforksweekly
microsoft/PowerToysC#C++PowerShell97.1k+2335.7k+18
rust-lang/rustlingsRustShellPowerShell42.7k+2067.8k+51
jasontaylordev/CleanArchitectureC#TypeScriptJavaScript13.7k+1993k+26
lstprjct/IDM-Activation-ScriptBatchfilePowerShell3.2k+143537+25
localsend/localsendDartC++CMake15k+138802+5
ryanoasis/nerd-fontsCSSShellPython46.9k+1163.4k+10
ChrisTitusTech/winutilPowerShell7.2k+102536+2
mo-jinran/LiteLoaderQQNTJavaScriptPowerShellShell1.7k+9386+1
bmaltais/kohya_ssPythonShellJavaScript6k+78788+9
LunarVim/LunarVimLuaShellPowerShell16.1k+691.5k+2