无法更改活动目录架构

时间:2015-03-26 07:53:05

标签: c# windows active-directory userprincipal

我正在研究AD用户管理应用程序。 C#,UserPrincipal。所以我需要为AD shema添加一些额外的属性,其中一个是BirthDate。

我们的AD服务器是2012 R2域控制器。 我正在关注手册:

  1. 打开mmc。
  2. 将“Active Directory Shema”添加到mmc。
  3. 在这一步我必须添加新属性,但我不能。它不活跃。像shema这样的菜单项如“添加属性”,但它不处于“启用”状态。
  4. 我的帐户具有“域管理员”和“Shema管理员”权限。
  5. 我添加了DWORD参数“Schema Update Allowed”,值为1到HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ NTDS \ Parameters \,甚至重新启动了服务器。 但我无法添加新属性。我做错了什么?
  6. 更新1 因此,建议使用扩展属性。这是我做的第一件事。

    [DirectoryObjectClass("user")]
    [DirectoryRdnPrefix("CN")]
    public class UserPrincipalEx : UserPrincipal
    {
        private const string _jobTitle = "extensionAttribute1";
        [DirectoryProperty(_jobTitle)]
        public string JobTitle
        {
            get
            {
                if (ExtensionGet(_jobTitle).Length != 1)
                    return null;
    
                return (string)ExtensionGet(_jobTitle)[0];
            }
            set
            {
                this.ExtensionSet(_jobTitle, value);
            }
        }
    }
    

    然后     userPrincipal.Save(); 导致“System.DirectoryServices.AccountManagement.PrincipalOperationException”,消息“指定的值或属性目录服务不存在。”

0 个答案:

没有答案
相关问题