Created
January 24, 2022 16:03
-
-
Save OlivierLaflamme/158e06ebfe3cbd5356f650871c077b87 to your computer and use it in GitHub Desktop.
Check if domain joined
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool isPartofDomain() | |
{ | |
NET_API_STATUS nas; | |
_NETSETUP_JOIN_STATUS status; | |
LPWSTR buf = NULL; | |
nas = NetGetJoinInformation(NULL, &buf, &status); | |
if (nas == NERR_Success) | |
{ | |
if (status == NetSetupDomain) | |
{ | |
return true; | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment