DirectoryEntry User = Container.Children.Add("User","CN=" + lmu_id); //create a new user
User.Properties["sAMAccountName"].Value= ntlogin; //set the properties of this user
User.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编辑过]