Use Powershell to lookup your PDC

Using Powershell to look up the PDC

Did you know that you can Use Powershell to lookup your PDC?

If you have ever needed to look up your primary domain controller (PDC) this can sometimes be a daunting task especially in a large enterprise environment. Luckily you can open PowerShell and run a single command to have the system to query active directory (AD) to determine the hostname of your current PDC (Primary Domain Controller).

Open PowerShell and then Run:
[System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().RootDomain.PdcRoleOwner.Name

This will return your PDC’s name like in the image below:

Use Powershell to lookup your PDC

This concludes the tutorial on how to get the PDC host name from Power Shell and shows how easy it can be to start using Windows Powershell.

Posted in PowerShell, Scripting, Windows, Windows 7, Windows 8, Windows Server, Windows Server 2012 R2 and tagged , , .

Leave a Reply

Your email address will not be published. Required fields are marked *