PowerTip: Use PowerShell to Get List of FSMO Role Holders

The Scripting Guys

Dr Scripto

Summary: Use Windows PowerShell to get a list of FSMO role holders in Active Directory.

Hey, Scripting Guy! Question I use NETDOM QUERY FSMO to list my domain controllers that hold the FSMO roles, but can I do it with Windows PowerShell?

Hey, Scripting Guy! Answer 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

 

The Scripting Guys
Dr Scripto

Follow Dr Scripto   

1 Comments
Avatar
andrew gauger 2019-03-21 08:47:53
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