473,395 Members | 1,668 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,395 software developers and data experts.

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.DirectoryServices.DirectoryEntry(objpath)

Dim inmembers As PropertyCollection = 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 6790
You may use the objectCategory property to identify the individual object
type.

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

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

Hope this helps.

"Alex" <in********@gmx.ch> wrote in message
news:#3**************@TK2MSFTNGP14.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.DirectoryServices.DirectoryEntry(objpath)

Dim inmembers As PropertyCollection = 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....Thanks Alex
"Shiva" <sh******@online.excite.com> wrote in message
news:uN**************@tk2msftngp13.phx.gbl...
You may use the objectCategory property to identify the individual object
type.

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

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

Hope this helps.

"Alex" <in********@gmx.ch> wrote in message
news:#3**************@TK2MSFTNGP14.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.DirectoryServices.DirectoryEntry(objpath)

Dim inmembers As PropertyCollection = 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
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...
9
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...
1
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...
10
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...
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...
9
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...
1
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 =...
6
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...
2
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...
0
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...
0
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,...
0
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...

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.