In my program I am trying to retrieve the domain name of the current machine. i found some code that people wrote in forums but they all seem to work partially.
what i mean is that my domain name is something like 'mydomain.mydomain11.com' and when trying to retrieve the domain name i always get only 'mydomain' instead of 'mydomain.mydomain11'
I also tried usng the 'GetEnvironmentVariable' function which returns the same thing.
If possible, i would like to know how can i retrieve the full path.
my final goal is to query active directory using LDAP protocol, so it will really help to know how can chunk the domain path to something like :
CN=Users,DC=mydomain,DC=mydomain11,DC=com
but getting my full domain name will do for now..