Weekly Tip 9

Save stale computer objects in AD as a variable:

import-module activedirectory
$date = (get-date).adddays(-120)
$comps = get-adcomputer -SearchBase “” -properties * -Filter ‘lastlogondate -lt $date

You can grab specific information, such as object name, by changing the last line to:
$comps = (get-adcomputer -SearchBase “” -properties * -Filter ‘lastlogondate -lt $date).Name

Share:

Facebook
Twitter
LinkedIn

Contact Us

Name
=
On Key

More Posts

WME Microsoft 365 Updates No. 025
Azure

WME Microsoft 365/Azure Updates 22 August 2025

1. Exchange Online: Temporary Mailbox Access Disruption via MAPI Overview Some Exchange Online users experienced mailbox access issues via the Messaging API (MAPI) on August 20, 2025. The disruption occurred after Microsoft reverted a recent service

Read More »
Be assured of everything

Get WME Services

Stay ahead of the competition with our Professional IT offerings.

=