I am querying Active Directory to select a list of displaynames and emails. I want to sort the list by displayname, but I am getting the following error:
Server doesn't support requested critical extension
here is my code
VB Code:
  1. DirSearch.Filter = (ConfigurationSettings.AppSettings("AllStaff"))
  2.                 DirSearch.PropertiesToLoad.Add("member")
  3.                 DirSearch.Sort.PropertyName = "member"
  4.                 DirSearch.Sort.Direction = SortDirection.Ascending
  5.                 [COLOR=darkred]Result = DirSearch.FindOne[/color]
  6.                 For X = 0 To Result.Properties("member").Count - 1
  7.                     UserSearch.Filter = ("(" & Left(Result.Properties("member").Item(X), InStr(Result.Properties("member").Item(X), ",") - 1) & ")")
  8.                     UserSearch.PropertiesToLoad.Add("Mail")
  9.                     UserSearch.PropertiesToLoad.Add("DisplayName")
  10.                     UResult = UserSearch.FindOne()
  11.                     Try
  12.                         Row = Tbl.NewRow
  13.                         Row.Item(0) = UResult.Properties("Mail").Item(0)
  14.                         Row.Item(1) = UResult.Properties("DisplayName").Item(0)
  15.                         Tbl.Rows.Add(Row)
  16.                     Catch ExNull As System.NullReferenceException
  17.                     Catch
  18.                         Response.Redirect("errorpage.aspx?err=" & Err.Number)
  19.                     End Try
  20.                 Next X
The line in dark red is where it errors out. Any ideas why this is happening?
if I remove DirSearch.Sort.PropertyName = "member" from the code it will not error out, but the results will not be sorted.

Ultimately what I need is an alphabetical list of Display Names and Emails.

Thanks for your assistance