#
# Removing Users to a Group using WLST (online)
# John Minkjan Ciber Netherlands
#
print 'lookup DefaultAuthenticator'
atnr=cmo.getSecurityConfiguration().getDefaultRealm().lookupAuthenticationProvider('DefaultAuthenticator')
groups = ['companya']
for group in groups:
users = ['user1','user2']
for user in users:
print 'removing user: ',user, ' from group:', group
try:
atnr.removeMemberFromGroup(group,user)
except:
print 'user: ', user , ' can not be removed from group: ', group
Till Next Time
No comments:
Post a Comment