Hi
Does any one know
Python Script to look for the users that belong to a particular group in weblogicÂ
Hi,
As the embedded LDAP is a normal LDAP any python script able to query an LDAP will work. It looks like there are many simple ways to interact with LDAP using python.
Are you asking for the wlst wrapper scripts for the group reader mbean?
ie:
sec=cmo.getSecurityConfiguration().getDefaultRealm().lookupAuthenticationProvider('DefaultAuthenticator')
users=sec.listGroups('username')
listGroups('username')
This for example would find all the groups the specified user belongs to. There are quite a few methods exposed via the wlst mbean wrappers. You could also iterate through all the groups and check if the user belongs the group by utilising the isMember() method.
I am looking for scripts to run through wlst
That's what I have shown you already. You just need to add the connect() and disconnect() around it and evaluate the cursor that got returned.
If you don't want to learn how to write your own script and just want to use an existing one, try this one Weblogic Scripting Tool 101: WLST List User, Groups and Users in Groups
Start with this:
https://github.com/RittmanMead/scripts/blob/master/obi/wlst/add_users.py