Discovering Active Directory FSMO Role Holders

Discovering Active Directory FSMO Role Holders

FSMO roles play a critical role in the functioning of the Active Directory (AD) environment. Of course, due to the design of these roles, they are distributed among a number of domain controllers in the AD network. This makes it tedious to identify which domain controllers are responsible for which role. There is no direct way to ascertain this information using any console. So, PowerShell can be used to obtain this information from the AD network.
 
A prerequisite before running the script given below is to have the ActiveDirectory module, which comes with the Remote Server Administration Tools package. After the package is installed on a workstation that is part of the domain, the administrator can identify which domain controllers in the domain are responsible for each of the FSMO roles, provided they have read permissions to the domain controllers.
 
The following PowerShell script will return the necessary information if the above-mentioned prerequisites are met:
 
  1. [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() | Select-Object *owner
  2. [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest() | Select-Object *owner