Get the IsTG and BHS DC of each site in your Active Directory Domain


You can get the “IsTG” and “BHS” domain controller of each site with that query :

$SiteSearcher = [ADSISearcher]"objectclass=site"
$dse = [adsi]"LDAP://RootDSE"
$SiteSearcher.SearchRoot = [ADSI]"LDAP://$ConfPart"
ForEach($Site in $Sites){
    #Ntds Site Settings
    [String]$NtdsSiteSettingsDN="CN=NTDS Site Settings,"+$Site.Properties.distinguishedname

    New-Object -TypeName PSObject -Property @{
        'Subnet'      = $Site.Properties.siteobjectbl | % {(($_ -replace 'CN=',',') -split ',')[1]}
        'Site'        = $($
        'Description' = $($Site.Properties.description)
        'IsTG'        = ($ -split ',CN=')[1]
        'BHS'         = $

This snippet does not require the Active Directory module, and works on PowerShell 2.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.