Re: Active Directory Sample Errors
From: Frank_00001 (Frank00001_at_discussions.microsoft.com)
Date: 02/07/05
- Next message: Keith Smith: "Re: Will C# work with Windows CE?"
- Previous message: Keith Smith: "Easy DataSet question"
- In reply to: Willy Denoyette [MVP]: "Re: Active Directory Sample Errors"
- Messages sorted by: [ date ] [ thread ]
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.
> >>
> >>
> >>
>
>
>
- Next message: Keith Smith: "Re: Will C# work with Windows CE?"
- Previous message: Keith Smith: "Easy DataSet question"
- In reply to: Willy Denoyette [MVP]: "Re: Active Directory Sample Errors"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|