473,597 Members | 2,726 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get Active Directory Object Type

Dear all

I hope you might help me. Here my issue:

I am using the following vb.net code to receive members from a windows 2000
active directory group:
objecttolook = "group"

objlook = "member"

Dim root As New System.Director yServices.Direc toryEntry(objpa th)

Dim inmembers As PropertyCollect ion = root.Properties

etc.

The Problem is now that this group could contain either users, workstation
account or other nested groups. How can I now determin what kind of object
do this group contain. I can read out the members but I don't know what time
they are. The idee is to call the function iterativ if if the member is a
group.

Hope somebody may gve me an idea.

Thanks Alex
Nov 21 '05 #1
2 6806
You may use the objectCategory property to identify the individual object
type.

If (DirectoryEntry .Properties("ob jectCategory")( 0) = "group") Then 'Call
recursively

Other possible values are:
DirectoryEntry. Properties("obj ectCategory")(0 ) = "user"
DirectoryEntry. Properties("obj ectCategory")(0 ) = "computer"
.... etc

Hope this helps.

"Alex" <in********@gmx .ch> wrote in message
news:#3******** ******@TK2MSFTN GP14.phx.gbl...
Dear all

I hope you might help me. Here my issue:

I am using the following vb.net code to receive members from a windows 2000
active directory group:
objecttolook = "group"

objlook = "member"

Dim root As New System.Director yServices.Direc toryEntry(objpa th)

Dim inmembers As PropertyCollect ion = root.Properties

etc.

The Problem is now that this group could contain either users, workstation
account or other nested groups. How can I now determin what kind of object
do this group contain. I can read out the members but I don't know what time
they are. The idee is to call the function iterativ if if the member is a
group.

Hope somebody may gve me an idea.

Thanks Alex

Nov 21 '05 #2
Perfect....Than ks Alex
"Shiva" <sh******@onlin e.excite.com> wrote in message
news:uN******** ******@tk2msftn gp13.phx.gbl...
You may use the objectCategory property to identify the individual object
type.

If (DirectoryEntry .Properties("ob jectCategory")( 0) = "group") Then 'Call
recursively

Other possible values are:
DirectoryEntry. Properties("obj ectCategory")(0 ) = "user"
DirectoryEntry. Properties("obj ectCategory")(0 ) = "computer"
... etc

Hope this helps.

"Alex" <in********@gmx .ch> wrote in message
news:#3******** ******@TK2MSFTN GP14.phx.gbl...
Dear all

I hope you might help me. Here my issue:

I am using the following vb.net code to receive members from a windows 2000 active directory group:
objecttolook = "group"

objlook = "member"

Dim root As New System.Director yServices.Direc toryEntry(objpa th)

Dim inmembers As PropertyCollect ion = root.Properties

etc.

The Problem is now that this group could contain either users, workstation
account or other nested groups. How can I now determin what kind of object
do this group contain. I can read out the members but I don't know what time they are. The idee is to call the function iterativ if if the member is a
group.

Hope somebody may gve me an idea.

Thanks Alex

Nov 21 '05 #3

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

Similar topics

0
2785
by: microsoft | last post by:
Hi People, when I try to modify an active directory user programatically, I receive the following exception: The server is unwilling to process the request Reading the microsoft web site, I found this article: http://support.microsoft.com/default.aspx?scid=kb;EN-US;248717 that says the following: ..........................
9
3710
by: Mario Rodriguez | last post by:
Hi people. I have a problem adding users to Win2003 active directory programatically. When I execute my app throws the following exception: .................The specified directory service attribute or value does not exist........... Exactly the same code works fine on my win2000 active directory. My app include the use of the extensionAtributes and I'm not sure if the extensionAttributes feature was removed from win2003 Active...
1
3289
by: Amadelle | last post by:
Hi all, I am so desparately in need of some guidance! After two days of struggling I still can't connect to the Active Directory server. I have used so many different ways and so many different string paths and I still don't have a successful connection. Things I have tried: Using Directory Searcher: DirectorySearcher ds = new DirectorySearcher(); ds.SearchRoot = new DirectoryEntry();
10
5425
by: huzz | last post by:
I have web application that quaries the Active Directory to get user details.. everything works fine but someday I'll get System.Runtime.InteropServices.COMExection and if I restart the client machine then it works again. here is one of the method where am calling the AD public bool UserExist(string UserName) {
1
4741
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 I have run into I am not sure how to fix, and really not sure what is causing it. Here's what is going on (test server - Windows 2003 Server): I have a page in a folder (under anonymous authentication in IIS6) that has a link on it that...
9
3166
by: Patrick | last post by:
I have an ASP.NET page that searches for someone in the corporate Active Directory. It had been working fine until recently when I changed from Basic Authentication on IIS6 back to Integrated Windows authentication. The error occurs on the FindAll method. The exceptions are as follows. anyway of getting the code working with Integrated Windows authentication (too annoying for user to enter user-name/password). Note I do need to use...
1
3890
by: tangus via DotNetMonster.com | last post by:
Hello all, I'm really struggling with getting some Active Directory code to work in ASP.NET. Can you please provide assistance? I am executing the following code: Dim enTry As DirectoryEntry = New DirectoryEntry("LDAP://domain") Dim mySearcher As New DirectorySearcher(enTry) Dim resEnt As SearchResult mySearcher.Filter = ("(objectClass=*)") mySearcher.SearchScope = SearchScope.Subtree
6
2455
by: varkey.mathew | last post by:
Dear all, Bear with me, a poor newbie(atleast in AD).. I have to authenticate a user ID and password for a user as a valid Active Directory user or not. I have created the IsAuthenticated function exactly as outlined in the below link. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT02.asp
2
12005
by: j.m.osterman | last post by:
I haven't found exactly what I've been trying to do. All I am trying to do for now is just display usernames from Active Directory into a ListBox control on a page. I have found some code however that will just capture a Full Name from Text Box and display information from the Active Directory into a DataTable. I will display that code below.
0
2496
by: bcanter | last post by:
I found a file on the web that will allow you to enumerate groups but it was an .hta and the top level admins won't allow this. I need to give managers access to the groups so that when a new user is created they can tell me who they want their account to be modeled after. The html app works great as a .hta file but when it is saved as a web page it won't list the members of any groups. I get an error on line 182: "ActiveX component can't create...
0
7979
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7894
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8381
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8262
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5847
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5437
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3893
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2409
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.