Loading |
VBScript |
JavaScript |
Powershell |
Search Options: List FSMO Role HoldersContent of List FSMO Role Holders.vbsMD5 Hash: 8BBBF11B0E64754E4172A938C5C96348 |
||
' Description: Identifies the Active Directory domain controllers providing the five FSMO roles: Schema Master, Domain Naming Master, PDC Emulator, RID Master, and Infrastructure Master.
Set objRootDSE = GetObject("LDAP://rootDSE") Set objSchema = GetObject _ ("LDAP://" & objRootDSE.Get("schemaNamingContext")) strSchemaMaster = objSchema.Get("fSMORoleOwner") Set objNtds = GetObject("LDAP://" & strSchemaMaster) Set objComputer = GetObject(objNtds.Parent) WScript.Echo "Forest-wide Schema Master FSMO: " & objComputer.Name Set objNtds = Nothing Set objComputer = Nothing Set objPartitions = GetObject("LDAP://CN=Partitions," & _ objRootDSE.Get("configurationNamingContext")) strDomainNamingMaster = objPartitions.Get("fSMORoleOwner") Set objNtds = GetObject("LDAP://" & strDomainNamingMaster) Set objComputer = GetObject(objNtds.Parent) WScript.Echo "Forest-wide Domain Naming Master FSMO: " & objComputer.Name Set objDomain = GetObject _ ("LDAP://" & objRootDSE.Get("defaultNamingContext")) strPdcEmulator = objDomain.Get("fSMORoleOwner") Set objNtds = GetObject("LDAP://" & strPdcEmulator) Set objComputer = GetObject(objNtds.Parent) WScript.Echo "Domain's PDC Emulator FSMO: " & objComputer.Name Set objRidManager = GetObject("LDAP://CN=RID Manager$,CN=System," & _ objRootDSE.Get("defaultNamingContext")) strRidMaster = objRidManager.Get("fSMORoleOwner") Set objNtds = GetObject("LDAP://" & strRidMaster) Set objComputer = GetObject(objNtds.Parent) WScript.Echo "Domain's RID Master FSMO: " & objComputer.Name Set objInfrastructure = GetObject("LDAP://CN=Infrastructure," & _ objRootDSE.Get("defaultNamingContext")) strInfrastructureMaster = objInfrastructure.Get("fSMORoleOwner") Set objNtds = GetObject("LDAP://" & strInfrastructureMaster) Set objComputer = GetObject(objNtds.Parent) WScript.Echo "Domain's Infrastructure Master FSMO: " & objComputer.Name | ||
© 2008 - 2013 Boris Toll :: Scripts available: 6.481 :: :: scriptbox.toll.at :: :: powered by www.toll.at :: |