获取NT风格的域\用户给定的DN [英] Get NT style domain\user given DN

查看:163
本文介绍了获取NT风格的域\用户给定的DN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Active Directory用户的DN,我想从这个NT风格的域\用户。该SAM帐户公元物业给我的用户部分,但对于域名?

I have the DN of a user in Active Directory, I want to get the "NT style" domain\user from this. The sAMAccountname AD property gives me the user part, but what about the domain?

感谢

推荐答案

您可以通过利用用户的最后一部分DN( DC =域,DC =本地),并加入 CN =分区,CN =配置,之前。

You can get it by taking the last part of the user DN (DC=domain,DC=local) and adding CN=Partitions,CN=Configuration, before.

然后做一个子树搜索(及(NCNAME =DC =域,DC =本地)(NETBIOSNAME = *)) CN =分区,CN =配置,DC =域,DC =本地为出发点;你回来的条目将在域的NetBIOS名称 NETBIOSNAME -attribute。

Then do a subtree search for (&(nCName="DC=domain,DC=local")(nETBIOSName=*)) with CN=Partitions, CN=Configuration, DC=domain, DC=local as the starting point; the entry you get back will have the NETBIOS name of the domain in the nETBIOSName-attribute.

这篇关于获取NT风格的域\用户给定的DN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆