Re: Active Directory Sample Errors

From: Frank_00001 (Frank00001_at_discussions.microsoft.com)
Date: 02/07/05


Date: Mon, 7 Feb 2005 06:53:02 -0800

I seem to be having some success with "DirectorySearcher" instead of going
the route I was trying here.

Thanks Anyway

"Willy Denoyette [MVP]" wrote:

> This is only a part of the code 99% is windows forms code but the essential
> parts are missing (where you create entryPC, please don't force us to go
> through the walkthrough; create a small console application that illustrates
> the problem and don't waste your time with walkthrough's.
>
> Willy.
>
> "Frank_00001" <Frank00001@discussions.microsoft.com> wrote in message
> news:9B3193BD-FA30-4410-ABD2-2E453C0FB9E9@microsoft.com...
> >I followed the instructions from "Walkthrough: Viewing Local Directory
> > Objects" copying the source directly from there and replacing the domain
> > with
> > my organization's domain and YourComputerName with my computer's name.
> >
> > The spot where it errors is in Form1_Load at the foreach statement
> > specifically on the entryPC.Children
> >
> > private void Form1_Load(object sender, System.EventArgs e)
> > {
> > TreeNode users = new TreeNode("Users");
> > TreeNode groups = new TreeNode("Groups");
> > TreeNode services = new TreeNode("Services");
> > viewPC.Nodes.AddRange(new TreeNode[] { users, groups, services });
> >
> > foreach(System.DirectoryServices.DirectoryEntry child
> > in entryPC.Children)
> > {
> > TreeNode newNode = new TreeNode(child.Name);
> >
> > switch (child.SchemaClassName)
> > {
> > case "User" :
> > users.Nodes.Add(newNode);
> > break;
> > case "Group" :
> > groups.Nodes.Add(newNode);
> > break;
> > case "Service" :
> > services.Nodes.Add(newNode);
> > break;
> > }
> > AddPathAndProperties(newNode, child);
> > }
> > }
> >
> > "Willy Denoyette [MVP]" wrote:
> >
> >>
> >>
> >> "Frank_00001" <Frank_00001@discussions.microsoft.com> wrote in message
> >> news:F4734117-144C-492F-B9E5-18D86A4A5416@microsoft.com...
> >> > I'm going to need to get a list of users for an upcoming project and
> >> > Active
> >> > Directory seems to be a good place to get it. I'm trying to get the
> >> > "Walkthrough: Viewing Local Directory Objects" example to work; but I
> >> > keep
> >> > getting...
> >> >
> >> > An unhandled exception of type
> >> > 'System.Runtime.InteropServices.COMException'
> >> > occurred in system.directoryservices.dll
> >> >
> >> > Additional information: Unspecified error
> >> >
> >> > I've tried a few things and nothing I do seems to work. Does anyone
> >> > know
> >> > what the problem might be?
> >> >
> >>
> >> Without seeing your code and the point that it fails? No.
> >>
> >> Willy.
> >>
> >>
> >>
>
>
>



Relevant Pages

  • Re: London to Glasgow in five minutes
    ... route was missing. ... For technical reasons a short stretch near Milton Keynes is missing ... I'd hardly call 90 miles 'a short stretch near Milton Keynes' though... ...
    (uk.railway)
  • Several Problems with Attribute handling in ATL with VS2005
    ... know if there's a way to write those two methods verbatim to the IDL file. ... tried idl_quote but had no success. ... Hopefully I'm just missing something ... Some attributes do not recognize the C++ preprocessor. ...
    (microsoft.public.vc.atl)
  • Re: running Microsoft Greetings 99 in Windows XP
    ... Something is missing." ... without any success. ... 6-second Google search reveals... ... When you try to start Home Publishing 99 or Greetings 99 on a Windows ...
    (microsoft.public.windowsxp.general)
  • Re: London to Glasgow in five minutes
    ... You pass Apsley, and the next frame puts you somewhere on ... route was missing. ... " For technical reasons a short stretch near Milton Keynes is missing from ...
    (uk.railway)
  • Re: Something to play with
    ... version it's been moved to the more elegant: ... I must be missing the point here. ... The only functionality that I can see ... All that is on the Route page is three adverts. ...
    (uk.rec.waterways)