January 2015
Intermediate to advanced
230 pages
5h 4m
English
The function discussed in this section is a simple wrapper on top of the Get-ADDomainController cmdlet to query all the domain controllers in forest and display frequently referred-to details, such as DC name, domain name, site name—whether these names are global catalog servers or not—and reachability of the domain controller:
Function Get-DCDetails { [CmdletBinding()] Param( ) $Domains = (Get-ADForest).Domains $DCs = $Domains | % { Get-ADDomainController -Filter * -Server $_ } foreach($DC in $DCs) { $OutputObj = New-Object -TypeName PSObject -Property @{ DCName = $User.Name; DCDomain = $null; IsGC = $null; SiteName = $Null; IsOnline = $null } if(Test-Connection -Computer $DC -Count ...Read now
Unlock full access