Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Search for subgroups within a group using ADSI

Posted on 2003-11-18
5
Medium Priority
?
308 Views
Last Modified: 2007-12-19
Hi,
I am trying to get the groups included in another group using ADSI. In the principal group  I have users and groups on it. I´m trying to get these groups included on the principal filtering the members collection, but i'm not getting the collection filtered. I'm using following code:

Dim adsgroup As ActiveDs.IADsGroup
      Dim adsSubGroup As ActiveDs.IADs
      Dim sFilter() As String

            adsgroup = GetObject(sFormattedGroupName)
            ReDim Preserve sFilter(0)
            sFilter(0) = "Group"
            adsMembers = adsgroup.Members

            adsMembers.Filter = sFilter

            For Each adsMembers In adsMembers

           next

Can anyone tell me why this is not working?

Thank you
0
Comment
Question by:purbano
  • 2
5 Comments
 
LVL 8

Expert Comment

by:Dranizz
ID: 9771447
There could be members of members, so use a function that recall itself if that appends

Also

  sFilter(0) = ("(objectClass=group)")

remember that filter is case sensitive, so the class type and the classname are case sensitive
0
 

Author Comment

by:purbano
ID: 9771721
Thank you Dranizz, but I'm afraid it doesn't work.

Any other idea.

Thanks
0
 
LVL 8

Accepted Solution

by:
Dranizz earned 1000 total points
ID: 9771795
Use the DirectoryServices.Dll reference
and use the DirectorySearcher class

look at this

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdirectoryservicesdirectorysearcherclasstopic.asp
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10268131
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: Dranizz {http:#9771795}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question