【发布时间】:2011-03-06 22:45:09
【问题描述】:
考虑此代码尝试创建 Active Directory 帐户。它在这里使用一组数据生成异常。目前尚不清楚是什么导致了异常。
var user = new UserPrincipal(someValidUserContext,
".x-xyz-t-FooFooBarTest", "somePwd", true);
user.UserPrincipalName = ".x-xyz-t-FooFooBarTest@foobarbatbaz.net";
user.SamAccountName = ".x-xyz-t-FooFooBarTest";
user.DisplayName = "Some String 16 chars long";
user.Name = "Some String 16 chars long";
user.Description = "Foo BarBaz 12 more characters";
user.AccountExpirationDate = someDateInFuture;
user.UserCannotChangePassword = true;
user.Save();
// exception thrown on Save():
// A device attached to the system is not functioning
PrincipalOperationException 未被用户代码处理: 连接到系统的设备无法正常工作
是什么导致了这个异常,你如何解决它?
【问题讨论】:
标签: c# active-directory asp.net-3.5