Re: listing Object properties from SearchResult

From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 05/13/05


Date: Fri, 13 May 2005 09:17:47 -0500

What did you put in to PropertiesToLoad? Also, it is possible that the
security context you bound with only has rights to see a subset of the
properties you requested.

Those are my two best guesses given what you've told us.

Joe K.

<dl> wrote in message news:OCHzJf4VFHA.1148@tk2msftngp13.phx.gbl...
> Hi
> I have the following lines of code that are suppose to list some selected
> properties of all the object entries in a SearchResult but the code is
> only
> listing one property ie. the 'sn' and the corresponding value for all the
> entries, do you have a clue why?
> TIA
> ----------------------
> foreach (SearchResult resEnt in resEntAll)
> {
> i++;
> dr = dt.NewRow();
> foreach (string propKy in resEnt.Properties.PropertyNames)
> {
> switch (propKy)
> {
> case "sn":
> y = 0;
> break;
> case "givenName":
> y = 1;
> break;
> case "telephoneNumber":
> y = 2;
> break;
> default:
> y = 3;
> break;
> }
> if (y < 3)
> {
> ResultPropertyValueCollection valco =
> resEnt.Properties[propKy];
> foreach (Object prop in valco)
> {
> dr[y] = prop.ToString();
> }
> }
> }
> dt.Rows.Add(dr);
> }
>
> --
>
>
>



Relevant Pages

  • RE: Accessing remote perfmon/PDH data from a service, how to
    ... If the service is attempting to access a remote system with LocalSystem ... The security context for the ... The service account will need rights to access the target resource just as ...
    (microsoft.public.win2000.security)
  • RE: means can, not is
    ... context forwarded from IIS(the security context maybe a client ... automatically at the initializing time of the worker thread. ... This posting is provided "AS IS" with no warranties, and confers no rights. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: ATL Service and kernal object
    ... The MFC client is probably running in the security context different from ... rights of the event's security descriptor ... CDacl dacl; ... CSecurityDesc sd; ...
    (microsoft.public.vc.atl)