#PSTip Discovering Active Directory FSMO Role Holders using PowerShell
Note: This tip requires PowerShell 2.0 or above.
Active Directory defines five FSMO roles:
- Schema master
- Domain naming master
- RID master
- PDC master
- Infrastructure master
The first two: schema master and the domain naming master are per-forest roles. There can be only one of each per forest. The other three: RID master, PDC master, and the infrastructure master are per-domain roles. Each domain has its own RID master, PDC master, and infrastructure master.
There are numerous ways and tools to help you get the information, including the PowerShell AD module. With the following code, you can get the forest and domain role holders of the current user using PowerShell only.
[System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() | Select-Object *owner [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest() | Select-Object *owner