How can I find Computers recently joined to Active Directory?
Edit: I've searched google for the title phrase, and have also searched here, but can find nothing specifically about filtering on when the Computer Account was created.
How can I find Computers recently joined to Active Directory?
Edit: I've searched google for the title phrase, and have also searched here, but can find nothing specifically about filtering on when the Computer Account was created.
All computer accounts that were created as of December 1, 2011 (12/01/2011) in the Active Directory:
Get-ADComputer -LDAPFilter "(&(objectCategory=computer)(whenCreated>=20111201000000.0Z))" -Properties whenCreated | Format-Table Name,whenCreated,distinguishedName -Autosize -Wrap
PowerShell, of course. Edit date to line up with your definition of "recent," and formatting to line up with your tastes or reporting needs.
And since that page/site had at least one error that someone else caught, I'm gonna not trust it at all. Here's some PowerShell I personally dashed off, which actually works as it's supposed to, without needing Ryan to fix it first. As above, adjust "recently" and formatting to meet your needs, of course.
$recently = [DateTime]::Today.AddDays(-30)
Get-ADComputer -Filter 'WhenCreated -ge $recently' -Properties whenCreated | Format-Table Name,whenCreated,distinguishedName -Autosize -Wrap
When run at work, in lieu of doing whatever boring work my boss has assigned me, I get the below output, for reference.