• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

fpoint

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

notsupportedException by active directory 2010-03-17 16:22 600人阅读 评论(2) 收藏

first, thx starfish's support, who offered the code below ;)

 

the package used by AD is System.DirectoryService;

DirectoryEntry is a leaf, and DirectoryEntries a collection of entries.

 

DirectoryEntry   oDE = new DirectoryEntry(_path, _userName, _password, AuthenticationTypes.Secure)

 

 

some words to path:

I wanted to modify or query some email adress from certain user. Because the users are scattered around the directories, so I can't use the usual CN=.. OU=.. stuff. so I did a query, found out the DirectoryEntry and then create a new Directory entry by the path element. with this methode I can get DN(distinguish name) of almost all elements. 

to be noticed is, that rootDSE ist not the real root, but rootDSE.Parent, if you do some query with rootDSE, you will get a notsupportedException, search not supported, don't think the admi has turned search off. rootDSE is a leaf! only container types supports search( it makes no sense by search elments in a single element). The rest is straight ahead and self explaining. (the code is based on the help source code  of starfish, thx a lot ;)))

版权声明:本文为博主原创文章,未经博主允许不得转载。

posted on 2010-03-17 16:22  fpoint  阅读(113)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3