Share via


Get-ADComputer to Export all Computers in OUs and Sub OUs Named Computers

Question

Wednesday, June 5, 2013 10:35 AM

Hello,

I want to export all the computer objects in our active directory without manually specifying the -SearchBase OU=... Is it possible? All our computers are are located in OUs named Computers under each department OUs.

Thanks,

Hussain

All replies (5)

Wednesday, June 5, 2013 12:38 PM ✅Answered

Hi,

Give this a shot:

Get-ADComputer -Filter * | Where { $_.DistinguishedName -like "*Computers*" }

Wednesday, June 5, 2013 1:03 PM ✅Answered

Thanks,

This works perfectly..

Get-ADComputer -Filter * | Where { $_.DistinguishedName -like "*Computers*" } | Select-Object Name, DistinguishedName | Format-Table -Wrap  >C:\Computers.txt

Wednesday, June 5, 2013 12:02 PM | 1 vote

Hi,

What about this.

Get-ADComputer -Filter * | FT *

Kottees : My Blog : Please mark it as an answer if it really helps you.


Wednesday, June 5, 2013 12:32 PM

Hi,

This would give the full details, is there a chance to just searching in an OUs where the names are Computers?


Friday, December 20, 2019 7:14 PM

Thanks

Harish