November 28th, 2014

PowerTip: Use PowerShell to Get List of FSMO Role Holders

Doctor Scripto
Scripter

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

 

Author

The "Scripting Guys" is a historical title passed from scripter to scripter. The current revision has morphed into our good friend Doctor Scripto who has been with us since the very beginning.

1 comment

Discussion is closed. Login to edit/delete existing comments.

  • andrew gauger

    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