Using the active directory module I need to Get-ADComputer of all the computers in an specific OU and list all their properties.
I tried something like this:
Get-ADComputer -Filter 'DistinguishedName -like "*OU=Testing*"'
Using the active directory module I need to Get-ADComputer of all the computers in an specific OU and list all their properties.
I tried something like this:
Get-ADComputer -Filter 'DistinguishedName -like "*OU=Testing*"'
What you are looking for (and probably could have found on your own if you had done a simple get-help get-adcomputer -detailed
) is the -SeachBase option for that command. Since you only want one specific OU you may want to use the -SearchScope option as well.
Get-ADComputer -searchbase "OU=Testing,CN=Some,CN=Domain,CN=Com" -SearchScope 0 -Filter *
Obviously you will need to change the path of the SearchBase to suite your needs.