It will take parameters for number of days, weeks, months, or years that you want to go back in time. It will take that and pull all devices that have not logged into AD since that time and remove them from AD and SCCM. There is also a parameter for search base, which is the OU of AD that you want to look in. It includes all of the same help items as well.
Free Script – Remove Old Objects from AD and SCCM
February 17, 2014
- Home
- Blog
- Free Script – Remove Old Objects from AD and SCCM
Share:
Facebook
Twitter
LinkedIn
Matt Tinney
Professional IT executive & business leader having decades of experience with Microsoft technologies delivering modern-day cloud & security solutions.
Get Microsoft Updates Before They Cost You Downtime
Retirement dates, licensing changes, and security updates from a Microsoft-exclusive team, sent when they matter, not on a filler schedule.
More Posts
Copilot Cowork: Credit-Based Billing
July 7, 2026
Until now, Copilot Cowork has been included with M365 Copilot Premium licenses. Now that Cowork has moved out of public preview, Cowork is introducing a ...
Read Full Article
SharePoint OTP Retirement Is Coming in July 2026 — What IT Admins Need to Do Before Access Breaks
June 23, 2026
Starting July 2026, external users who access OneDrive and SharePoint files through legacy SPO OTP links will start receiving access denied — silently, with no ...
Read Full Article
Power Virtual Agents Is Gone. Here’s What Replaced It and Why It Matters.
June 12, 2026
If someone on your team still calls it “Power Virtual Agents,” they’re working from an outdated map. Microsoft retired the product on November 15, 2023 ...
Read Full Article



