The client had a legacy script that scans their client's AD attached computers. One small thing this script does is to determine the Domain Functional Level and whether the domain is still in mixed mode.
The 'old' script we were looking at was a very long, comment-free VBS script using LDAP to get the Domain Object in the AD to get the values for those two attributes to determine the domain level. You might think you could convert that horrid VB code into a simple Get-ADDomain, pick out the two properties.
Sadly, that does not work. The Get-ADDomain cmdlet returns a number of properties that represent the attribute values inside the AD. But not all!
Here is a screenshot of LDP.EXE showing the domain object and two properties inside my AD: