I would normally get the distinguished name of a member computer on the Active Directory network by calling:
TCHAR buff[256];
buff[0] = 0;
DWORD dwSz = SIZEOF(buff);
GetComputerObjectName(NameFullyQualifiedDN, buff, &dwSz);
But the issue happens when that member computer is currently not connected to a DC. For instance, if I take my work laptop home it will not have access to the local AD we have at work and the GetComputerObjectName
will fail. (I believe with the error code 1355 or ERROR_NO_SUCH_DOMAIN
.)
So my question is, is there any way to get the distinguished name of a member computer in that situation?