Pass to DsGetDCName() the name of a domain. That will get you the name of
the server on which the domain controller runs. Then you can use that server
name in a call NetUserEnum() to enumerate all of the accounts in the domain
or NetUserGetInfo() to retrieve information about a particular account.
Of course, you may need account operator privileges or some such to access
the data.