The following code in Powershell gets me the ntdsaGUID of a DC (for use in repadmin)
Get-ADDomainController -filter * | Select-Object -Property Name, IPv4Address, @{n='DsaGuid'; e={(Get-ADObject $_.NTDSSettingsObjectDN).ObjectGUID}}
I am having a hard time generating equivalent in C#.
There is a private member on DomainController
(derived from: domain.DomainControllers
) called NtdsaObjectGuid
but I don't know if I can get to that, even though VS can.
Is there a supported way to get the DSA GUID of a DC in C#?
Thanks!