惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
J
Java Code Geeks
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
量子位
T
Tailwind CSS Blog
Vercel News
Vercel News
I
InfoQ
Stack Overflow Blog
Stack Overflow Blog
U
Unit 42
Engineering at Meta
Engineering at Meta
L
LangChain Blog
大猫的无限游戏
大猫的无限游戏
D
Docker
博客园_首页
P
Proofpoint News Feed
月光博客
月光博客
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Martin Fowler
Martin Fowler
腾讯CDC
N
Netflix TechBlog - Medium
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - Francis Liang

Windows Azure存储容器私有,公共容器,公共Blob的区别 关于Windows Azure 地缘组(Affinity Groups) 使用Windows Azure创建和发布ASP.NET应用程序 创建并使用Windows Azure虚拟机模板 Windows Azure 设置虚拟机静态外网IP地址 Windows Azure 配置多个站点的虚拟网络连接 Windows Azure 虚拟网络配置(Site to Site) Windows Azure 虚拟网络配置(Point to Site) Microsoft Azure云计算第一步—试用帐户申请 拥抱云计算 《Microsoft Office SharePoint Server 2007 Best Practices》书评 修改MOSS2007内容查询部件实现自定义格式显示 IISRESET命令功能新发现 动态改变ASP.net页面标题和动态指定页面样式表 Biztalk Server 2006安装配置 Web开发中对元素样式使用过滤器以增强其可视化效果 使用DIME协议上传文件 使用证书来做RSA非对称式加密 使用MSAgent代替传统的MessageBox提示来增用客户端用户体验
[.NET Active Directory开发]根据NativeGuid获取DirectoryEnt...
Francis Liang · 2007-07-04 · via 博客园 - Francis Liang

     今天写一篇关于使用.NET进行Active Directory开发方面的文章
 
大家都知道NativeGuidActive Directory中对象的唯一标识,那么如何通过这个GUID来获取(查询)到相应DirectoryEntry对象的实例呢?
    .NET Framework
中的DirectoryService命名空间下并没有直接提供相应的方法,不过可以通过以下方法来获取:
    
假设在Active Directory中有一个用户:
     DN
为:CN=user1,OU=办公室,DC=njgw,DC=com
     NativeGuid
为:a46cc1f54eaf8c428cda3753e59265f6
    
使用以下代码:
     DirectoryEntry entry=new DirectoryEntry();
     entry.Path =
LDAP://ServerAddress/<GUID=a46cc1f54eaf8c428cda3753e59265f6>;
     entry.Username="Administrator";
     entry.Password="Administrator_Password";
    
即可获取到该用户的DirectoryEntry实例,怎么样?是不是比使用DirectorySearcher更方便、更准确呢?

posted @ 2007-07-04 21:22  Francis Liang  阅读(3221)  评论()    收藏  举报