Results 1 to 2 of 2

Thread: DirectoryServices Error: Server doesn't support requested critical extension

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Posts
    66

    DirectoryServices Error: Server doesn't support requested critical extension

    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
    Jason Meckley
    Database Analyst
    WITF

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Posts
    66
    I found a work around, while it's not the most elegant, it works.
    I load the member attribute into an ArrayList object and then sort the list.
    VB Code:
    1. DirSearch.Filter = (ConfigurationSettings.AppSettings("AllStaff"))
    2.                 DirSearch.PropertiesToLoad.Add("member")
    3.                 Result = DirSearch.FindOne
    4.                 For X = 0 To Result.Properties("member").Count - 1
    5.                     Member.Add(Left(Result.Properties("member").Item(X), InStr(Result.Properties("member").Item(X), ",") - 1))
    6.                 Next
    7.                 Member.Sort()
    8.                 For X = 0 To Member.Count - 1
    9.                     UserSearch.Filter = ("(" & Member.Item(X) & ")")
    10.                     UserSearch.PropertiesToLoad.Add("Mail")
    11.                     UserSearch.PropertiesToLoad.Add("DisplayName")
    12.                     UResult = UserSearch.FindOne()
    13.                     Try
    14.                         Row = Tbl.NewRow
    15.                         Row.Item(0) = UResult.Properties("Mail").Item(0)
    16.                         Row.Item(1) = UResult.Properties("DisplayName").Item(0)
    17.                         Tbl.Rows.Add(Row)
    18.                     Catch ExNull As System.NullReferenceException
    19.                         'do nothing
    20.                     Catch
    21.                         Response.Redirect("errorpage.aspx?err=" & Err.Number)
    22.                     End Try
    23.                 Next
    Jason Meckley
    Database Analyst
    WITF

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width