-1

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.

korylprince
  • 169
  • 1
  • 1
  • 9
  • 1
    Please include research effort in your post. – Colyn1337 Nov 21 '14 at 15:35
  • We're here to help...but there appears to be little to no research done on this issue up front and/or there's very little for someone here to go on to assist you. It is recommended that you post things you've already tried, options you are considering, or errors that you are experiencing. The more details you provide (logs, screenshots, etc.), the better the experts here can assist you. – TheCleaner Nov 21 '14 at 15:50
  • @korylprince - to help you out...you should have started your question with the links and research you did up front in order to show that effort. The experts here can only go off of what is posted...not what was intended. To keep the question from looking cluttered you can simply add the "research" you did at below your actual question or bold the question/parts that are relevant. I didn't downvote or upvote you, but if you'll edit your original question with relevant research I'll give it an upvote. – TheCleaner Nov 21 '14 at 15:55
  • @korylprince You weren't donwvoted because of the way you asked ... well, I assume not, as I didn't downvote you. I was just being a smartass. That said, the first thing I thought when I saw this was "what a lazy question, I searched Google and got an answer right away." Turns out the answer I got had an error in it, and I knew what to search on, but a simple statement of what you found from searching can ward off a lot of that sentiment, and probably some of the downvotes too. I don't think you'd have any downvotes if you started with what you have now. (Maybe one or two.) – HopelessN00b Nov 21 '14 at 16:03
  • Take this question: http://serverfault.com/questions/41224/what-is-the-point-of-creating-a-computer-object-in-active-directory-when-you-sti?rq=1 Objectively, it's more opinion-based, and also contains no research (he could have said how he researched for an answer) - just sayin'... I got my answer and I'm happy so I'll get off my high horse now. Thanks guys :) – korylprince Nov 21 '14 at 16:16
  • @korylprince - that question is 5 years old. Our community standards and expectations have changed over time. – mfinni Nov 21 '14 at 16:29
  • I still think this question is of bad quality, but it meets the minimum needed to remove a downvote (which I've done). – Colyn1337 Nov 21 '14 at 16:32
  • @Colyn1337 I'm not being facetious - What would make this a better question? – korylprince Nov 21 '14 at 16:36
  • As this site is for professional systems administrators I would have expected some basic knowledge of AD Objects. There's no mention of effort on your part of what you'd tried to do (other than google). This question is essentially "give me da codez". – Colyn1337 Nov 21 '14 at 16:40

1 Answers1

11

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.

enter image description here

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208