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

Get members from a Domain global group over LDAP

2
I receive only members from domain global goup in wich my NT-Account is too.
If domain global group belongs to a foreigner domain i get no members.
Perhaps I will not be able cause I got not enaugh rights. So I start to search only for goupnames and a users in foreigner Domains and I get all Information.
Next step I start to search the member with the Windowsexplorer and I recive also all members of the foreigner domain global group.

I belong to the domain de.firma.com
The foreigner Domain us.firma.com


Expand|Select|Wrap|Line Numbers
  1. strPath = "GC://dc=firma,dc=com"
  2.  
  3.         strGroupName = groupName
  4.  
  5.         Try
  6.             objADAM = New DirectoryEntry(strPath)
  7.             objADAM.RefreshCache()
  8.         Catch e As Exception
  9.             MessageBox.Show("LDAP-Name unbekannt!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
  10.             Return
  11.         End Try
  12.  
  13.         Try
  14.             objSearchADAM = New DirectorySearcher(objADAM)
  15.             ' Mögliche Werte für ObjectClass: Group; User, Printer, Computer etc.
  16.             objSearchADAM.Filter = "(&(objectClass=*) (cn=" & strGroupName & "))"
  17.             objSearchADAM.SearchScope = SearchScope.Subtree
  18.             objSearchResults = objSearchADAM.FindAll()
  19.         Catch e As Exception
  20.             MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
  21.             Return
  22.         End Try
  23.  
  24.         ' List groups and members.
  25.         Try
  26.             If objSearchResults.Count > 0 Then
  27.                 Dim objResult As SearchResult
  28.  
  29.                 For Each objResult In objSearchResults
  30.                     objGroupEntry = objResult.GetDirectoryEntry()
  31.  
  32.                     Dim members As Object = objGroupEntry.Invoke("members", Nothing)
  33.                     For Each member As Object In CType(members, IEnumerable)
  34.                         ' Read Surename,Givenname and Department 
  35.                         Dim strNTUsernameDetails As String = ActiveDirectoryUser.Exists(strNTUsername)
  36.                         If strNTUsernameDetails Is String.Empty Then
  37.                             groupEntries.Add(strNTUsername)
  38.                         Else
  39.                             groupEntries.Add(strNTUsernameDetails)
  40.                             strNTUsernameDetails = String.Empty
  41.                         End If
  42.                     Next member
  43.  
  44.                 Next objResult
  45.  
Jan 25 '08 #1
2 4560
kenobewan
4,871 Expert 4TB
Have you tried a sperate query for each domain?
Jan 26 '08 #2
antem
2
Have you tried a sperate query for each domain?
Oooooh noooo. That's it. Thanks a lot. However, why I get no members if I take the Domain firma.com? I try it with the Domain us.firma.com an I get all member. Im working in a Big Big Domain. About 800 Domains. Maybe the reason is the big value of Domains.
Jan 28 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Maziar Aflatoun | last post by:
Hi everyone, I'm having a problem with reading user groups on Active Directory using C#. It returns all the groups in the Universal scope for a specific user. However, I only need the groups in...
2
by: dln | last post by:
Hello all. Our organization has multiple domains, all of which are part of the same forest. Using the DirectorySearcher class, how would I specify a search root that would allow the AD search to...
7
by: Peter Steele | last post by:
I have code to add a domain user to a local group but I'm not sure if it will work with NT domains or whether it will only work with Active Directory based systems. Here's the code: public void...
6
by: Gawel | last post by:
Hajo, I am searching solution for this proble over 2 days. I need to be able to create mailboxes on exchange server that is in domain. I need to do it outside of domain. What is more I can...
1
by: missoula | last post by:
Hello- I can connect to my own domain fine with the following: entry = new DirectoryEntry("LDAP://RootDSE"); However, I am trying to get information out of AD for another domain. This...
3
by: mrwoopey | last post by:
Hi, I am using the example "Authenticate against the Active Directory by Using Forms Authentication and Visual Basic .NET": http://support.microsoft.com/default.aspx?scid=KB;EN-US;326340 ...
0
by: Kevin Buchan | last post by:
I have some code to query Active Directory group membership, based on an LDAP path. This works beautifully in my test exectuable, but when I try to move the class I built into an ASP.Net web...
23
by: BH Jodo Kast | last post by:
Hi, I found this handy script and I'm trying to convert it to VB.NET. It pops up a list of members in the Administrators/Builtin group. Can't seem to get DirectorySearcher or DirectoryEntry...
0
by: Uli Netzer | last post by:
Hi all, I'm trying to add a user from another domain (domain trust and rights are there) to a group in our domain. It's a domain local security group. I get the following errors: The server...
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...
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
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...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.