0

I am trying to programatically find the root domain name using c++. There are lots of example of how to find the domain (I am using the example referenced there) ie:

How to get Windows domain name?

The example above also mentions that it returns the Forest name but I have tested it on 3 different domains and it does not while the c# example below does:

  [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest();

Any ideas?

Thank you

gulmc
  • 1
  • 1
  • What do you mean that it does not? Using the code in [this answer](https://stackoverflow.com/a/9798104/1202807), `info->DomainForestName` should have the forest name. – Gabriel Luci Sep 28 '22 at 19:23
  • 1
    If you have non-working code, then you should post that code. Very hard to debug code that we cannot see. – john Sep 28 '22 at 19:36

0 Answers0