$SearchPath = "OU=computers1,DC=domain,DC=org",
"OU=computers2,DC=domain,DC=org",
"OU=computers3,DC=domain,DC=org",
$SearchPath | %{ Get-ADComputer -SearchBase $_ -filter * -Properties name } | Select-Object name
$computers
- Details
- Category: PowerShell