I have an vb.net method where I want to take a comma delimited list of AD
groups , split them into an array and loop through the groups returning all
users who are a member of the groups. I've eliminated most of the code to
show the example below:
For icount = GroupList.GetLowerBound(0) To
GroupList.GetUpperBound(0)
Dim oMembers As DirectoryEntry = New
DirectoryEntry("WinNT://" & GetDomainName() & "/" & GroupList(icount) &
",group", GetDomainName() & "\" & GetAdminUserName(), GetAdminPassword())
Dim MembersCollection As IADsMembers
MembersCollection = oMembers.Invoke("Members")
oMembers.Close()
oMembers.Dispose()
Next
The first time through the loop everything works great, but the second time
through the loop I get "The network path was not found". It doesn't matter
which groups are first - it always works and the second always fails. It
fails on the MembersCollection = oMembers.Invoke("Members") line.
Any ideas why this is happening are appreciated,
Jason MacKenzie
|