How to do it...

To locate the domain controllers running the FSMO roles, run the following command on any domain-joined device, member server, or domain controller:

netdom.exe query fsmo

Or, use the following PowerShell commands on a domain-joined system that has the Active Directory Module for Windows PowerShell installed:

Import-Module ActiveDirectory

Get-ADForest | Format-List DomainNamingMaster,SchemaMaster

Get-ADDomain | Format-List InfrastructureMaster,PDCEmulator,RIDMaster