I need to perform, in program code, some of the tasks that DfsDiag.exe performs w/respect to reading & validating some of the DFS configuration information for domain-integrated DFS namespace roots.
There are DFS API functions to add/remove a specific Windows server to/from the list of servers that are configured to host the root of a domain-integrated DFS namespace. These functions are NetDfsAddFtRoot() and NetDfsRemoveFtRoot(). However, there aren't any NetDfs*() API functions to enumerate the servers that are currently hosting the root of any particular domain-integrated DFS namespace.
The authoritative source of this information is contained within AD in objects dedicated to the purpose of storing DFS configuration information, and then each server that has the DFS service running on it reads this information at boot time and replicates some it down to the server's registry under "HKLM\CurrentControlSet\Services\Dfs\Parameters".
Each server that is hosting the root of a DFS namespace will have a DFS share present with the same name as the namespace, and the local path for that share will be the location on disk where the structure of the namespace is replicated in a series of directories & reparse points. I could do brute-force examination of all shares on all servers looking for matching names, and then interrogate those shares for information, but the method fails if some of the servers that host the DFS namespace root are not currently available.
Before I begin directly interrogating the registry on various server or AD itself to obtain this information, I wanted to know if there was some otherwise obscure API function or COM interface that is available to do this in a supported manner.
Any links to supporting documentation that might be helpful?