In short - How do I translate a NETBIOS domain to a FQDN ?
简而言之 - 如何将NETBIOS域转换为FQDN?
Details: Assuming I'm in domain A and I have user credentials for domain B which has a trust relationship with domain A (I can authenticate the credentials). How do I get domain B's FQDN when all I have are the credentials of some authenticated user from that domain, including the netbios domain name?
详细信息:假设我在域A中,并且我拥有域B的用户凭据,该域与域A具有信任关系(我可以对凭据进行身份验证)。当我拥有的是来自该域的某个经过身份验证的用户的凭据(包括netbios域名)时,如何获取域B的FQDN?
I'm coding in C# but a COM/WMI/Win32 solution would be welcomed as well.
我在C#编码,但COM / WMI / Win32解决方案也会受到欢迎。
3 个解决方案
#1
3
This probably isn't optimal, but it look like you could do a NetBIOS name query to get an IP address, and then do a reverse DNS lookup to get an FQDN from that...
这可能不是最佳的,但看起来您可以执行NetBIOS名称查询以获取IP地址,然后执行反向DNS查找以从中获取FQDN ...
http://www.protocolbase.net/protocols/protocol_NBNS.php
(The reverse DNS step is easy to look up)
(反向DNS步骤很容易查找)
#2
1
What kind of access do you have to the other domain? What server/service in the other domain are you authenticating against?
您对其他域有什么样的访问权限?您正在对其他域中的服务器/服务进行身份验证?
Do you have ip-access to a domain server in the other domain? If so then you could do a call like this:
您是否可以对其他域中的域服务器进行ip访问?如果是这样,那么你可以这样做一个电话:
DirectoryEntry rootDSE = new DirectoryEntry("LDAP://10.11.12.13/rootDSE", @"DOMAIN\Username", "Password");
Console.WriteLine(rootDSE.Properties["defaultNamingContext"].Value);
(Replace 10.11.12.13 with the domain server address).
(将10.11.12.13替换为域服务器地址)。
You will get a reply in form "DC=company,DC=org" that represents the FQDN (just rebuild it by removing the DC-part and insert dots)
您将收到表示“DC = company,DC = org”表示FQDN的回复(只需通过删除DC部分并插入点来重建它)
#3
0
Bind to the domain using the WinNT provider and filter for all user accounts. Start enumerating the user accounts.
使用WinNT提供程序绑定到域并筛选所有用户帐户。开始枚举用户帐户。
If the user account sAMAccount name does not contain the string "duplicate" then exit from the loop and use the NameTranslate object to look up the LDAP name of the account.
如果用户帐户sAMAccount名称不包含字符串“duplicate”,则退出循环并使用NameTranslate对象查找帐户的LDAP名称。
Part of the LDAP name is the domain FQDN.
LDAP名称的一部分是域FQDN。
Hey, it's a fudge but it works like a charm.
嘿,这是一个软糖,但它的作用就像一个魅力。
#1
3
This probably isn't optimal, but it look like you could do a NetBIOS name query to get an IP address, and then do a reverse DNS lookup to get an FQDN from that...
这可能不是最佳的,但看起来您可以执行NetBIOS名称查询以获取IP地址,然后执行反向DNS查找以从中获取FQDN ...
http://www.protocolbase.net/protocols/protocol_NBNS.php
(The reverse DNS step is easy to look up)
(反向DNS步骤很容易查找)
#2
1
What kind of access do you have to the other domain? What server/service in the other domain are you authenticating against?
您对其他域有什么样的访问权限?您正在对其他域中的服务器/服务进行身份验证?
Do you have ip-access to a domain server in the other domain? If so then you could do a call like this:
您是否可以对其他域中的域服务器进行ip访问?如果是这样,那么你可以这样做一个电话:
DirectoryEntry rootDSE = new DirectoryEntry("LDAP://10.11.12.13/rootDSE", @"DOMAIN\Username", "Password");
Console.WriteLine(rootDSE.Properties["defaultNamingContext"].Value);
(Replace 10.11.12.13 with the domain server address).
(将10.11.12.13替换为域服务器地址)。
You will get a reply in form "DC=company,DC=org" that represents the FQDN (just rebuild it by removing the DC-part and insert dots)
您将收到表示“DC = company,DC = org”表示FQDN的回复(只需通过删除DC部分并插入点来重建它)
#3
0
Bind to the domain using the WinNT provider and filter for all user accounts. Start enumerating the user accounts.
使用WinNT提供程序绑定到域并筛选所有用户帐户。开始枚举用户帐户。
If the user account sAMAccount name does not contain the string "duplicate" then exit from the loop and use the NameTranslate object to look up the LDAP name of the account.
如果用户帐户sAMAccount名称不包含字符串“duplicate”,则退出循环并使用NameTranslate对象查找帐户的LDAP名称。
Part of the LDAP name is the domain FQDN.
LDAP名称的一部分是域FQDN。
Hey, it's a fudge but it works like a charm.
嘿,这是一个软糖,但它的作用就像一个魅力。