【问题标题】:ADAM - Is there a way to "store" application specific attributes?ADAM - 有没有办法“存储”应用程序特定的属性?
【发布时间】:2009-06-29 14:08:01
【问题描述】:

我已经设置了 ADAM,并且我已经编写了 Web 服务来完成管理任务,例如添加新用户等。(我有多个应用程序使用同一个 ADAM 实例)

我想要实现的可能听起来有点奇怪 - 但基本上我希望管理员用户能够选择 Web 服务应该从 ADAM 返回的属性。例如。应用程序 1 应返回 displayName 和电话号码,但应用程序 2 可能不需要返回相同的属性。

目前我已经设置了一个 SQL Server 表来存储用户选择要返回的属性,然后在 Web 服务中循环通过它来加载所需的属性并将结果添加到要返回的数组中(如果你的有兴趣我会在底部添加代码)。

我想知道是否有更好的方法来做到这一点?是否可以在 ADAM 本身中存储类似的内容?

提前感谢您的帮助!

//using linq to access table
DataClasses1DataContext db = new DataClasses1DataContext();

var queryAttributes = from atr in db.AttributesToReturns
                      where atr.appNumber == appNumber
                      select atr;

 ArrayList userD = new ArrayList();
 foreach (var a in queryAttributes)
 {
      //the col 'attribute' contains the exact name in active direct e.g. displayName 
      string att = a.attribute.ToString();
      searcher.PropertiesToLoad.Add(att);
  }

 //--code omitted but here perform search & get req Directory Entry
 foreach (var a in queryAttributes)
 {
      string attributeName = a.attribute.ToString();

      try
     {
           string value = user.Properties[attributeName].Value.ToString();
          //do something with value - here i am updating a user object which will be added to the ArrayList the webservice is returning
           updateUser(u, attributeName, value); 
    }
      //if an error - just set value to empty
      catch (Exception ex)
      {
             string value = "NULL";
             updateUser(u, attributeName, value); 
      }


    }
      userD.Add(u);

【问题讨论】:

  • 伙计,显然这毕竟不是专门针对我的:(

标签: active-directory adam


【解决方案1】:

【讨论】:

  • hmmm 所以你的意思是创建一个存储多个字符串的属性并添加要返回的属性?我会试试谢谢:)
  • 您可以扩展现有对象类的架构,但如果您觉得它更适合您的需求,您也可以创建新的。
  • 此外,如果您保留 LDF 文件,您可以在需要时扩展其他 LDAP 系统(OpenLDAP、Active Directory 和 eDirectory 等等)。
猜你喜欢
  • 2021-04-29
  • 1970-01-01
  • 2022-08-23
  • 2015-03-25
  • 1970-01-01
  • 2012-08-17
  • 1970-01-01
  • 2023-02-22
  • 1970-01-01
相关资源
最近更新 更多