List all DCs, including the Operating System they run:
Get-ADDomainController -Filter * | fl Name,HostName,OperatingSystem,Site
Return the Current Time & Time Zone for all AD DCs in an AD Forest:
$ADDCs = (Get-ADForest).Domains | %{ Get-ADDomainController -Filter * -Server $_ }
$ADDCs | %{
$TimeZone = Get-WmiObject -Class win32_timezone -ComputerName $_
$LocalTime = Get-WmiObject -Class win32_localtime -ComputerName $_
$strOutput = @{‘Computer Name’ = $LocalTime.__SERVER;
‘Time Zone’ = $TimeZone.Caption;
‘Current Time’ = (Get-Date -Day $LocalTime.Day -Month $LocalTime.Month);
}
$Object = New-Object -TypeName PSObject -Property $strOutput
$Object
}