PowerShell Lab
Build, find and save PowerShell
Reviewed templates and commands with requirements, permissions and risk spelled out. Nothing here runs anything — you copy, review and run it yourself.
Search pages, tools, PowerShell commands and ports
Which domain controllers hold the five operations master roles.
1#Requires -Modules ActiveDirectory2$domain = Get-ADDomain3$forest = Get-ADForest4[PSCustomObject]@{5 PDCEmulator = $domain.PDCEmulator6 RIDMaster = $domain.RIDMaster7 InfrastructureMaster = $domain.InfrastructureMaster8 SchemaMaster = $forest.SchemaMaster9 DomainNamingMaster = $forest.DomainNamingMaster10}The PDC emulator is where account lockouts are recorded (Event ID 4740).