在 Active Directory 中查找用户的经理记录
我正在使用 Active Directory 尝试查找用户经理的 SamAccountName 和电子邮件。
我通过搜索在 AD 中找到登录用户,其中 sAMAccountName = Domain\Account。 然后,我检索经理属性,如下所示:
CN=Doe\, Jane E.,OU=Employees,OU=Users,OU=Detroit,OU=United States,DC=na,DC=gmc,DC=gmc,DC=com"
我如何使用这个假定的密钥来查找此人的用户记录? 我会在什么领域进行匹配?
Using Active Directory, am trying to find the SamAccountName and email of the user’s manager.
I find the logged on user in the AD by search where sAMAccountName = Domain\Account. I then retrieve the manager property, which looks like this, for example:
CN=Doe\, Jane E.,OU=Employees,OU=Users,OU=Detroit,OU=United States,DC=na,DC=gmc,DC=gmc,DC=com"
How can I use this presumed key to find the user record for this person? What field would I match on?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果我没记错的话,那是他们的专有名称,这意味着您可以使用它作为对其个人资料的直接引用,
我也认为如果个人资料存在,它会返回该名称。 如果它已被删除,那么我相信它运行某种 GUID(基于内存 - 这可能不正确)
If I remember correctly, that is their Distinguished Name, which means you can use it as the direct reference to their profile
I also think it will return that name if the profile exists. If it has been deleted then I believe it runs a GUID of some sort (based on memory - this might be incorrect)
管理器的条目是管理器的绑定字符串。 您可以通过将其绑定到将返回经理信息的对象来将其反馈到对活动目录的请求中。
The entry for the manager is the manager's Binding String. You can feed it back into a request to active directory by binding it to an object that will return the manager's information.
(这是旧时的帖子,但我认为可能对社区中的其他人有用)
您可以使用字符串剥离并像这样找到它:
REPLACE(SUBSTRING(manager, 4, CHARINDEX('OU=', manager)-5), '\', '')
完整的工作查询(只需将 DOMAIN 更改为您自己的):
(This is a post from old time, but I thought might be useful for others in the community)
You can use string stripping and find it like this:
REPLACE(SUBSTRING(manager, 4, CHARINDEX('OU=', manager)-5), '\', '')
Full working query (just change DOMAIN to your own):