How can I check the name of the Azure AD domain that a Windows machine is joined to?

Viewed 178

I am currently using the DsRoleGetPrimaryDomainInformation API to get the name of the domain that the computer is joined to. However, this does not appear to work for Azure AD domains, in which case this API returns a null response.

Is there any other API that can be used locally, without reaching out to a server, to determine which Azure AD domain a computer is joined to?

1 Answers
Related