-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidateLdapGroup.java
More file actions
44 lines (33 loc) · 1.3 KB
/
Copy pathvalidateLdapGroup.java
File metadata and controls
44 lines (33 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.app;
import java.util.List;
import javax.naming.NamingException;
import javax.naming.directory.SearchControls;
import com.cisco.brmspega.util.ldap.LdapUtil;
import com.app.LdapUtilLocal;
public class validateLdapGroup {
public static void main(String[] args) throws NamingException {
// TODO Auto-generated method stub
String submit = "List Ldap Group";
String ldapGroupName = "brms_prod_cpe_lme_usr";
ldapGroupName="brms_stage_cpe_sr_lti_mngr";
//ldapGroupName="brms_prod_cpe_sr_user";
//ldapGroupName="brms_prod_cpe_sr_lme_usr";
//String ldapGroupName = "brmservice";
List<String> users = null;
if ((submit != null && submit.equals("List Ldap Group")) || ldapGroupName != null) {
//ldapGroupName = request.getParameter("lGN");
//LdapUtil ldapUtil = new LdapUtil();
LdapUtilLocal ldapUtil = new LdapUtilLocal();
users = ldapUtil.getSearchBasedUserIds(ldapGroupName, "OU=Groups,O=cco.cisco.com", SearchControls.SUBTREE_SCOPE, false);
}
System.out.println("Total Users:"+users.size());
if (users != null && users.size() > 0) {
System.out.println("USER UNDER LDAP GROUP ::"+ldapGroupName);
int count = 0;
for (String user : users) {
count = count + 1;
System.out.println(count + ":" +user);
}
}
}
}