How can I find recently joined computers in ActiveDirectory with a PowerShell command?
Asked
Active
Viewed 135 times
1 Answers
1
All computer objects in AD have a whenCreated attribute you can filter against just like any other attribute.
Here's an example:
$lastWeek = (Get-Date).AddDays(-7)
Get-ADComputer -Filter { whenCreated -ge $lastWeek }
Keep in mind that this will only find newly created computer objects. If you have orphaned objects that get overwritten by new computers with the same name, the attribute will not be updated.
Ryan Bolger
- 16,472
- 3
- 40
- 59