Using something like Get-ADDomainController -Forest would be something too easy for module designers at Microsoft. Or does Microsoft no longer have multi-domain forests in its internal IT?
Never mind, here is a nice snippet to retrieve that you may want to adapt to the fields you need to retrieve
1 |
(Get-ADForest).Domains | % { Get-ADDomainController -Discover -DomainName $_ } | % { Get-ADDomainController -server $_.Name -filter * } | Select Name, Domain, Forest, IPv4Address, Site | ft |
Just what I was looking for to resolve an inquiry @job. Thank’s Dimitri and people like you that help making the command line journey one friendly and more understandable even for dummies like me.
I hope one day I reach the level so I can do a contribution like this one myself.
Cheers!!
Great PowerShell script. You know what your doing, as i’m new to the PS game, much appreciated though. This was able to get me what I needed quickly instead of using ADUC and exporting.
Thanks a bunch