Discover FSMO Roles with PowerShell


With PowerShell the defacto standard for Windows management I’ve started digging into it a little more as I need to.  Recently I had to use PS to seize the FSMO roles from a failed DC.  Now in my lab I only had two DCs, DC01 and DC02.  DC01 was the first and therefore held the FSMO roles and I didn’t need to do anything to figure out where they were.

But in a larger environment you may need to run the following commands to determine where the roles are held.  There are two commands we need to use, Get-ADForest for the Schema Master and Domain Naming Master roles and Get-ADDomain for the PDC Emulator, RID Master and Infrastructure Master roles.

Now you could look the role holders up in your documentation (you have documented this right?) but it might be quicker to fire up PowerShell and run the following commands:

Get-ADForest <domain_name> | Format-Table SchemaMaster,DomainNamingMaster

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

That is all there is to it. The roles will be listed in a nice formatted table.  Now if you are wondering why I piped the output to Format-Table it was simply so I could limit the results to the information I was looking for.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: