forked from pvelder/wlst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgroups_zms.py
52 lines (42 loc) · 1.62 KB
/
groups_zms.py
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
45
46
47
48
49
50
51
52
# go to %JDEV_HOME%\wlserver_10.3\common\bin and start wlst.cmd
# execfile('c:/...../groups_zms.py')
import sys
import traceback
print 'args' + str(sys.argv)
if len(sys.argv) != 4:
print "Invalid Arguments: " + str(sys.argv)
print " Usage: groups_zms.py adminuser password adminurl"
exit()
username=sys.argv[1]
password=sys.argv[2]
url=sys.argv[3]
connect(username,password,url)
serverConfig()
print 'lookup DefaultAuthenticator'
atnr=cmo.getSecurityConfiguration().getDefaultRealm().lookupAuthenticationProvider('DefaultAuthenticator')
# create ADF application groups
ADFgroups=['WFMUsers','WFMAdministrators','WFMManagement']
for group in ADFgroups:
print 'Creating group ' + group
try:
atnr.createGroup(group,group)
except:
apply(traceback.print_exception, sys.exc_info())
# create COVOG groups
groups=['G-COVOG-Administratief','G-COVOG-JuniorMedewerker','G-COVOG-Medewerker','G-COVOG-SAMR','G-COVOG-FuncBeheer','G-COVOG-OperManage','WFMAdministrators','WFMUSers']
for group in groups:
print 'Creating group ' + group
try:
atnr.createGroup(group,group)
except:
apply(traceback.print_exception, sys.exc_info())
## Add Usergroups(COVOG) to Application groups
print 'Add groups ZMS to COVOG groups'
atnr.addMemberToGroup('WFMUsers','G-COVOG-Administratief')
atnr.addMemberToGroup('WFMUsers','G-COVOG-JuniorMedewerker')
atnr.addMemberToGroup('WFMUsers','G-COVOG-Medewerker')
atnr.addMemberToGroup('WFMUsers','G-COVOG-SAMR')
atnr.addMemberToGroup('WFMAdministrators','G-COVOG-FuncBeheer')
atnr.addMemberToGroup('WFMAdministrators','G-COVOG-OperManage')
atnr.addMemberToGroup('WFMManagement','G-COVOG-OperManage')
disconnect()