Determine if machine is joined to AzureAD

1.4k Views Asked by At

With AzureAD you can join a machine so that it belongs to Workgroup or a regular domain, and then it can also be joined to AzureAD.

Something like joeblow.onmicrosoft.com, with maybe a username like [email protected]

Is there a Win32 API to determine if it is joined? Is there a registry key to search?

Closest I can find is

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CloudDomainJoin\JoinInfo\FDAFC88ANDENOUGHTOMAKE40CHARS with a Property named UserEmail and a value of [email protected]. It also has other key value pairs like TenantId (a guid), ldpDomain = login.microsoft.net, and device display name which is the name of my laptop. I'm at home and am not joined to a domain...so normal login is to workgroup for the domain.

Is there a Win32 API to determine if it is joined? Is there a registry key to search?

0

There are 0 best solutions below