Active Directory and WMI
A lot of the Active Directory related functionality has been removed from WMI but there is a little bit left in the root\MicrosoftActiveDirectory namespace.
This is on a Windows 2008 R2 domain controller – I don’t know if this is available on down level versions of Windows.
Get-WmiObject -Namespace root\MicrosoftActiveDirectory -List | where {$_.Name -notlike "__*"}
ReplicationProvider1
MSAD_ReplPendingOp
Microsoft_TrustProvider
Microsoft_DomainTrustStatus
Microsoft_LocalDomainInfo
MSAD_NamingContext
MSAD_ReplCursor
MSAD_DomainController
MSAD_ReplNeighbor
The mixture of naming conventions doesn’t help but lets start looking at some domain information
Get-WmiObject -Namespace root\MicrosoftActiveDirectory -Class Microsoft_LocalDomainInfo
The following properties of interest are returned
DCname : SERVER02
DNSname : Manticore.org
FlatName : MANTICORE
SID : S-1-5-21-3881460461-1879668979-35955009
TreeName : Manticore.org
We can also get a quick replication test
Get-WmiObject -Namespace root\MicrosoftActiveDirectory -Class MSAD_DomainController |
select CommonName, DistinguishedName, IsAdvertisingToLocator, IsGC, IsNextRIDPoolAvailable,
IsRegisteredInDNS, IsSysVolReady, NTDsaGUID, PercentOfRIDsLeft, SiteName,
@{N="OldestQueuedAddition"; E={$_.ConvertToDateTime($_.TimeOfOldestReplAdd)} },
@{N="OldestQueuedDeletion"; E={$_.ConvertToDateTime($_.TimeOfOldestReplDel)} },
@{N="OldestQueuedModification"; E={$_.ConvertToDateTime($_.TimeOfOldestReplMod)} },
@{N="OldestQueuedReplicationSync"; E={$_.ConvertToDateTime($_.TimeOfOldestReplSync)} },
@{N="OldestQueuedReplicationUpdate"; E={$_.ConvertToDateTime($_.TimeOfOldestReplUpdRefs)} }
CommonName : SERVER02
DistinguishedName : CN=NTDS Settings,CN=SERVER02,CN=Servers,CN=Site1,CN=Sites,CN=Configuration,DC=Manticore,DC=org
IsAdvertisingToLocator : True
IsGC : True
IsNextRIDPoolAvailable : False
IsRegisteredInDNS : True
IsSysVolReady : True
NTDsaGUID : baba1150-8a6a-41ac-9889-4b69268d3f7c
PercentOfRIDsLeft : 91
SiteName : Site1
OldestQueuedAddition : 01/01/1601 00:00:00
OldestQueuedDeletion : 01/01/1601 00:00:00
OldestQueuedModification : 01/01/1601 00:00:00
OldestQueuedReplicationSync : 01/01/1601 00:00:00
OldestQueuedReplicationUpdate : 01/01/1601 00:00:00
The 1601 dates mean nothing is queued