![](/img/trans.png)
[英]not able to create and fetch user in java from OpenDS active directory
[英]Not able to fetch users form Active directory
我需要獲取組中存在的所有用戶。 我假設組G1和內部有兩個子組,如sg1,sg2,而這兩個組具有要獲取的用戶。
這是我正在使用的,但僅獲得sg1和sg2,而不是其中的用戶
searchFilter = "(&(objectCategory=*)(memberOf="+distinguishedName+"))"
有人可以幫我如何讓用戶進入sg1和sg2。如果需要更多信息,請告訴我。謝謝!
更新:
我正在嘗試使用Java執行此操作。
通過應用下面的過濾器,我能夠從每個子組中獲取用戶,但不是全部,只有少數用戶。
> searchFilter =
> "(&(|(objectClass=group)(objectClass=user))(memberOf:1.2.840.113556.1.4.1941:="+distinguishedName+"))"
解決所有成員(包括嵌套的)安全組(至少需要Windows 2003 SP2)
(memberOf:1.2.840.113556.1.4.1941:=CN=GroupOne,OU=Security Groups,OU=Groups,DC=YOURDOMAIN,DC=NET)
或僅檢索屬於成員的用戶:
(&(objectClass=user)(memberof:1.2.840.113556.1.4.1941:=CN=GroupOne,OU=Security Groups,OU=Groups,DC=YOURDOMAIN,DC=NET)
已知可以使用ldap查詢 。 確保您在Microsoft Active Directory中具有適當的權限才能執行查詢。
您可以使用LDAP瀏覽器進行測試。 像Apache Studio這樣的東西。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.