$theTitle=wp_title(" - ", false); if($theTitle != "") { ?>
About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like
17 Jun // php the_time('Y') ?>
I needed to obtain the Fully Qualified Domain Name (FQDN) for a given NetBios domain name. Eg from MYDOMAIN to dc=mydomain,dc=local.
I did some tests with the TranslateName API and if you append a \ to the domain name it returns the FQDN.
Here is a short example:
1 2 3 4 5 6 7 8 | var Buffer: array[0..MAX_PATH] of Char; nSize: DWORD; begin nSize := Length(Buffer); ZeroMemory(@Buffer, SizeOf(Buffer)); Win32Check(TranslateName('MYDOMAIN\'), NameSamCompatible, NameFullyQualifiedDN, Buffer, nSize)) end; |
2 Responses for "Obtain Fully Qualified Domain Name from Netbios Domain Name"
Can we rely on this function if the computer on which the above code is executed is not joined to the MYDOMAIN?
@Petar: MSDN docs state that it needs to bind to an Active Directory Domain Controller. So I think the computer must be joined to MYDOMAIN or another domain that can resolve the netbios domain (eg a trusted domain).
Leave a reply