Summary: Use Windows PowerShell to get a list of FSMO role holders in Active Directory.
I use NETDOM QUERY FSMO to list my domain controllers that hold the FSMO roles, but can I do it with Windows PowerShell?
As usual, there is more than one way to do most things in Windows PowerShell, but here are some syntax examples to meet your needs:
Get-ADDomain | Select-Object InfrastructureMaster, RIDMaster, PDCEmulator
Get-ADForest | Select-Object DomainNamingMaster, SchemaMaster
Get-ADDomainController -Filter * |
Select-Object Name, Domain, Forest, OperationMasterRoles |
Where-Object {$_.OperationMasterRoles} |
Format-Table -AutoSize
Just a reminder, in case you get The term ‘Get-ADDomain’ is not recognized as the name of a cmdlet, you can execute this:
import-module activedirectory