在Active Directory中查找用户的CN [英] Finding CN of users in Active Directory

查看:545
本文介绍了在Active Directory中查找用户的CN的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到能够访问或控制所有用户在Active Directory中,所以我可以把它放在我的LDAP用户的基本DN。

I'm trying to find the Base DN of the user that can access or controls all the users in Active Directory so I can put it in my LDAP.

通常会有人给我这个,它看起来像 DC =域,DC =公司,DC = COM

Usually someone will give me this, and it looks like DC=domain,DC=company,DC=com

但管理员不可用,所以我不知道如何找到这个在Active Directory中。

But the admin is not available, so I don't know how to find this in Active Directory.

我在寻找一步步找到了这个信息。其中树和选项卡来打开和如何构建它。 我的用户是:管理员,服务器: controller-16.domain.company.com 但我不知道他们是否添加OU或团体或其他什么东西

I'm looking for a step by step to find this info. Which tree and tabs to open and how to construct it. My user is: admin, the server is: controller-16.domain.company.com But I don't know if they added OU or groups or something else

我知道这一点:

CN=admin,DC=domain,DC=company,DC=com

不起作用。也不:

does not work. Nor does:

DC=domain,DC=company,DC=com

如果基本DN工程 Gawor的LDAP浏览器< /一>,那么它会为我的LDAP。

If the Base DN works on Gawor's LDAP Browser, then it will work for my LDAP.

推荐答案

您可以尝试我的海狸ADSI浏览器 - 它应该显示当前AD树,并从它,你应该能够找出路径和所有

You could try my Beavertail ADSI browser - it should show you the current AD tree, and from it, you should be able to figure out the path and all.

或者,如果你在.NET 3.5中,使用 System.DirectoryServices.AccountManagement 命名空间,你也可以做到这一点编程方式:

Or if you're on .NET 3.5, using the System.DirectoryServices.AccountManagement namespace, you could also do it programmatically:

PrincipalContext ctx = new PrincipalContext(ContextType.Domain);

这将创建一个基本的,默认域范围内,你应该能够偷看其属性,并从中找到了很多东西。

This would create a basic, default domain context and you should be able to peek at its properties and find a lot of stuff from it.

或者

UserPrincipal myself = UserPrincipal.Current;

这会给你一个 UserPrincipal 对象为自己,再次,一吨的属性来检查的。我不是100%肯定,你在寻找什么 - 但你很可能将能够找到它的上下文或用户主体的地方

This will give you a UserPrincipal object for yourself, again, with a ton of properties to inspect. I'm not 100% sure what you're looking for - but you most likely will be able to find it on the context or the user principal somewhere!

这篇关于在Active Directory中查找用户的CN的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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