[求助] 如何编辑active directory 里面节点的属性?
我最近在写个小程序,用以管理active directory。但是在对其中节点属性编辑的时候遇到了麻烦。。。程序部分代码如下:(用来增加节点)
DirectoryEntry User = Container.Children.Add("User","CN=" + lmu_id); //create a new user
User.Properties[
"sAMAccountName"].Value= ntlogin; //set the properties of this userUser.Properties[
"userPrincipalName"].Value = login;User.Properties[
"mail"].Value = email;User.Properties[
"displayname"].Value = anzeigename;User.Properties[
"givenName"].Value = vorname;User.Properties[
"sn"].Value = nachname;User.Properties[
"initials"].Value = geschlecht;User.Properties[
"streetAddress"].Value = strasse;User.Properties[
"telephoneNumber"].Value = telefon;User.Properties[
"postalcode"].Value = plz;User.Properties[
"l"].Value = wohnort;User.Properties[
"description"].Value = studentenstatus;User.Properties[
"physicalDeliveryOfficeName"].Value = matrikelnummer;User.Properties[
"department"].Value = fach;User.Properties[
"company"].Value = fakultät;User.Properties[
"st"].Value = nationalität;User.Properties[
"postOfficeBox"].Value = co;User.Properties[
"profilePath"].Value = "\\ub15.public.ub.uni-muenchen.de";User.Properties[
"scriptPath"].Value = "campus.cmd";User.CommitChanges();
//save the changes of the properties我在编译的时候,在最后一行User.CommitChanges 那里出现Exception(HRESULT: 0x8007200B)我在网上搜过,但是没有答案,请问谁知道原因的能不能指点下小弟,在这里先谢过了。
[此贴子已经被作者于2007-9-19 21:38:02编辑过]