Powershell: Search computers in AD
Posted on 2016-08-05
I need assistance with a query that would search the computer object in the forest, and return the dnshostname of the computer object. I have a file with 100+ computer names. There are about 10 domains in the forest, and the computer object could be in any of the domains. The following line only looks at the domain I am logged in.
Get-ADComputer <computer name> | select dnshostname
Thanks much for your help.