Created
March 29, 2016 10:58
-
-
Save JamesCalleja/2e083bc21e66708f76c2 to your computer and use it in GitHub Desktop.
Full list of computer in the forest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Run from top level domain to get a full list of computer in the forest, excluding the top level domain (just run get-adcomputer for them) | |
(get-addomain).childdomains | %{(Get-ADDomainController -Discover -Domain $_).hostname} | %{Get-ADComputer -Filter * -Server $_ -properties * | select name,dnshostname, enabled, distinguishedname,LastLogOnDate } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment