DirectoryServicesCOMException
全部标签 我正在尝试在WindowsServer2008R2(已安装IIS7)上运行的ASP.Net(4.0)应用程序中查询AD。(它在作为2.0应用程序运行时也会失败)这对我来说并不是什么新鲜事,因为我以前做过很多次。我编写了一个小的ASP.Net程序,它在我自己的机器(带IIS6的WindowsXP)上运行良好,但在2008机器上运行时失败。(结果是您在文本框中看到用户所属组的列表)(onbutton_click)varuserName=txtUserName.Text;if(userName.Trim().Length==0){txtResults.Text="--MISSINGUSERN
UserPrincipalSamAccountNamethrowsDirectoryServicesCOMExceptionunhandled"Alocalerrorhasoccured"我正在编写一段代码,它应该根据他们的SamAccountName作为搜索参数在活动目录中搜索特定用户GivenName(forename)和Surname,然后返回一个包含他们的名字和姓氏的字符串.目前我写的代码如下:123456789101112131415161718192021publicstaticstringGetName(stringuName) { StringBuilderbuilde
UserPrincipalSamAccountNamethrowsDirectoryServicesCOMExceptionunhandled"Alocalerrorhasoccured"我正在编写一段代码,它应该根据他们的SamAccountName作为搜索参数在活动目录中搜索特定用户GivenName(forename)和Surname,然后返回一个包含他们的名字和姓氏的字符串.目前我写的代码如下:123456789101112131415161718192021publicstaticstringGetName(stringuName) { StringBuilderbuilde