473,397 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Active Directory Sample Errors

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?

Nov 16 '05 #1
4 3003


"Frank_00001" <Fr*********@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.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.
Nov 16 '05 #2
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" <Fr*********@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.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.

Nov 16 '05 #3
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" <Fr********@discussions.microsoft.com> wrote in message
news:9B**********************************@microsof t.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" <Fr*********@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.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.

Nov 16 '05 #4
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" <Fr********@discussions.microsoft.com> wrote in message
news:9B**********************************@microsof t.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" <Fr*********@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.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.


Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Amol Shambharkar | last post by:
Hello Everyone, I am hoping someone could help me out with this.I am using Visual Studio .NET 2003 to create a web application on a remote IIS 5.0 server using the File Share web access method.The...
4
by: Dave | last post by:
Hello. I am trying to update attributes in LDAP/Active directory from my application that is written in VB.NET. I am using Directory Services to do so. I do not get any errors during the...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
5
by: Chris Davoli | last post by:
I'm trying to call Active Directory and validate userid exists in active directory. This is on a web site. Since a web site is on a server, #1 how do I get the userid in vb.net on the client...
2
by: Alpha | last post by:
I need to retrieve and set information in Active Directory in a new project that I'll be working on. I went to Amazon.com to look for a good book on this subject but found books on this subject...
2
by: P Webster | last post by:
We recently moved a web site that validated user credentials in Active Directory from IIS 5.1 to IIS 6, and the validation code no longer works. The web.config file is set to Windows authentication...
4
by: IainM | last post by:
How can I enumerate AD objects (only in a given OU, not sub OUs) using the DirectoryEntry object? Let me know of this is the wrong forum for this question. Thanks, Iain
18
by: Arthur | last post by:
Hi All, I would like to get the name of the user given their networkID, is this something Active Directory would be useful for?(For intranet users) If so, can you please point me to some sample...
3
by: MuZZy | last post by:
Hi, I'm trying to find a way to call a standard ActiveDirectory search dialog from my C# app, so i can pick a domain or computer user an dreturn it to the app. It's a search like one showing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.