微软ADAM笔记

    微软ADAM是一个独立的目录服务器,类似于活动目录(ActiveDirectory),但没有和Window集成在一起。也就是说,它不需要域服务器而单独运行,同时包含活动目录的功能。如果要开发基于目录服务的应用,ADAM是个不错的选择。  
    微软ADAM是一个独立的目录服务器,类似于活动目录(ActiveDirectory),但没有和Window集成在一起。也就是说,它不需要域服务器而单独运行,同时包含活动目录的功能。如果要开发基于目录服务的应用,ADAM是个不错的选择。

 

通过ADAM ADSI Edit修改ADAM用户密码

> C:\WINDOWS\ADAM>dsmgmt
> dsmgmt: ds behavior
> ds behavior: connections
> server connections: connect to server localhost:389
> Binding to localhost:389 ...
> Connected to localhost:389 using credentials of locally logged on user.
> server connections: quit
> ds behavior: allow passwd op on unsecured connection
> Successfully modified DS Behavior to reset password over unsecured network.
> ds behavior: list current ds-behavior
> Password operations on unsecured connection: Allowed.
>> ds behavior: quit 


使用LDIFDE导入导出

C:\WINDOWS\ADAM>ldifde -f schema.ldf -s localhost:389 -d "CN=Schema,CN=Configuration,CN={9CAA2CEC-62B8-4EC6-A28D-27CB8A7AB8C0}"

注意:一定要写明-s localhost:389,否则ldifde找不到缺省的域服务器,会报错无效参数: 没有有效的 DC”

C:\WINDOWS\ADAM>ldifde -v -i -f c:\temp\temp.ldf -s localhost:389 -c "CN=Schema,CN=Configuration,DC=X" "#schemaNamingContext"
 

扩展Schema语法定义的办法

   Schema可以理解为所有要在目录中存放的节点对象的类型定义(可以说是类的定义)。要放入目录的所有节点都是这些类的实例。目录中所有节点的属性(如:name 之于 Person)也必须在Schema中定义,如:guid,password,email-address类的定义在Schema中叫classSchema;属性的定义Schema中叫attributeSchema

    有下列方法可扩展Schema:

  • 从已有Schma定义中继承类 子类继承所有父类的属性。需要通过继承来扩展Schma的情况:
    • When the existing class requires additional attributes, but otherwise is acceptable.
    • When the ability to transform existing objects of the class into a new class is not required. It is not possible to add a subclass to an existing object.
    • To use the existing Directory Manager snap-in to manage the extended attributes of the objects.
  • 加入属性到已有的类定义上. When adding multiple attributes, perform this operation in a structured manner by defining an auxiliary class and adding that auxiliary class to the existing class.
  • Modification of an existing class is required when an application requires the ability to extend existing objects of the class. For example, to add application-specific data to the User object, extend the class User normally, because you must handle existing Users and not just special Users created by your application.
  • 创建新类定义. Create a new class; that is, a class derived from "Top" when no existing class fulfills the operational requirements

使ClassAttribute失效
attributeSchema(属性语法定义)的 isDefunct 属性 设为TRUE.
classSchema(类语法定义)的 isDefunct 属性 设为TRUE.
 

通过.NetDirectoryServices访问ADAM

使用DirectoryServices访问ADAM时,是通过COM来访问的,因此必须手动清除对象,而不能依赖于GC。方法:
1.        Dispose()
2.        Using
using (DirectoryEntry entry = new DirectoryEntry("LDAP://localhost:20389/cn=MSDN"))
{      
        Console.WriteLine(entry.Properties["cn"]);
} 

通过SSL访问ADAM 
DirectoryEntry entry = new DirectoryEntry(
               "LDAP://localhost:20389/cn=MSDN",
                "username",
                "password",  
               AuthenticationTypes.Secure);

出错处理

错误号

描述

解决

80005000

E_ADS_BAD_PATHNAME

路径(Path)不可用

                      

SetPassword失败 

XP, ADAM的使用会有一些限制;

Windows 2003上该问题已经解决,

XP上打Hotfix 817583, 或者,

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\forceguest 设置为 0

 

posted @ 2006-07-17 12:08  观无明  阅读(1560)  评论(0编辑  收藏  举报