Get Active Directory Object Type

A

Alex

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
 
S

Shiva

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.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top