Each domain has a PDC emulator FSMO role so how do I determine which domain controller holds the PDC emulator FSMO role in the forest root domain if I have multiple domains in my forest? Sounds like you can’t see the forest root for the trees :-).
The answer of course is with PowerShell:
1 2 3 4 | Get-ADForest | Select-Object -ExpandProperty RootDomain | Get-ADDomain | Select-Object -Property PDCEmulator |
The Active Directory PowerShell module which is part of the Remote Server Administration Tools (RSAT) is installed on the workstation these commands are being run from. The module is automatically imported since the workstation is running a new enough version of PowerShell to take advantage of the module auto-loading feature that was first introduced in PowerShell version 3.
µ
This was my simple one. . .
http://vernanderson.wordpress.com/2013/09/18/determine-if-localhost-is-a-domain-controller/
In result we got :
PDCEmulator
——————————
dc01.mikefrobbins.com
How to do for get ONLY :dc01.mikefrobbins.com
Expanding the PDCEmulator property will return the result you’re looking for:
(get-addomain).pdcemulator is faster and gives the output of hostname
Faster is a relative term. While your command is less to type, this blog article is specifically about retrieving the name of the domain controller that hosts the PDC emulator FSMO role in the forest root domain. Your version retrieves the PDC emulator in the current domain which is not necessarily the forest root domain unless there is only one domain in the Active Directory environment.