
| Current Path : /var/www/web-klick.de/dsh/10_customer2017/1215__continental/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/web-klick.de/dsh/10_customer2017/1215__continental/TestAccounts.ldif |
import re
import sys
def create_ldif ():
text = '''
version: 1
##########################################################################################################
#################################### AD
##########################################################################################################
version: 1
# create container for AD test account
#
dn: ou=ChildCG,ou=AD,ou=ident,ou=data,o=conti
changetype: add
objectClass: organizationalUnit
objectClass: ndsLoginProperties
objectClass: Top
objectClass: ndsContainerLoginProperties
ou: ChildCG
'''
text1 = '''
# create test user for Notes test account
#
dn: cn=wschreibAD,ou=ChildCG,ou=AD,ou=ident,ou=data,o=conti
changetype: add
objectClass: Top
objectClass: ndsLoginProperties
objectClass: Person
objectClass: organizationalPerson
objectClass: DirXML-Identity
objectClass: auxPhoneBook
objectClass: auxADAccount
objectClass: auxPerson
objectClass: DirXML-ApplicationAttrs
objectClass: inetOrgPerson
cn: wschreibAD
sn: Schreiber
ACL: 2#subtree#cn=wschreibAD,ou=ChildCG,ou=AD,ou=ident,ou=data,o=conti#[All
Attributes Rights]
ACL: 6#entry#cn=wschreibAD,ou=ChildCG,ou=AD,ou=ident,ou=data,o=conti#loginSc
ript
ACL: 2#entry#[Public]#messageServer
ACL: 2#entry#[Root]#groupMembership
ACL: 6#entry#cn=wschreibAD,ou=ChildCG,ou=AD,ou=ident,ou=data,o=conti#printJo
bConfiguration
ACL: 2#entry#[Root]#networkAddress
auxC: DE
co: Germany
company: Continental Automotive GmbH
departmentNumber: 459K
displayName: Schreiber, Wolfgang
givenName: Wolfgang AD
loginDisabled: FALSE
loginExpirationTime: 20180226000000Z
loginGraceLimit: 6
loginGraceRemaining: 6
mail: wolfgang.schreiber-ext@continental-corporation.com
ou: CorpIT IN OP CS SD EU
passwordAllowChange: TRUE
passwordExpirationInterval: 7776000
passwordExpirationTime: 20180214181051Z
passwordMinimumLength: 6
passwordRequired: TRUE
passwordUniqueRequired: TRUE
physicalDeliveryOfficeName: Schwalbach
postalCode: 12345
street: Contistrasse 12
dn: cn=wschreibAD,ou=ChildCG,ou=AD,ou=ident,ou=data,o=conti
changetype: modify
add: userPassword
#userPassword=NetIQ000
userPassword:: TmV0SVEwMDA=
-
'''
list_of_notes_test_accounts = [
'cgabriel01AD',
'cgabriel02AD',
'cgabriel03AD',
'cgabriel04AD',
'cgabriel05AD',
]
for o in list_of_notes_test_accounts:
text2 = re.sub(r"wschreibAD",o,text1,99999999)
text = text + text2
text = text + '''
##########################################################################################################
#################################### Choose accounts
##########################################################################################################
'''
text1 = text1 + '''
#add mail, change sn to associate AD record
dn: cn=uidf7021,ou=Child02,ou=AD,ou=ident,ou=data,o=conti
changetype: modify
replace: sn
sn: Scheer-Schreiber
-
replace: mail
mail: wolfgang.schreiber-ext@continental-corporation.com
-
'''
list_of_choosen_accounts = {
'cn=25efls01,ou=Child05' : "ABC-Gabriel",
'cn=25efls04,ou=Child05' : "DEF-Gabriel",
'cn=25eict01,ou=Child05' : "UVW-Gabriel",
'cn=25elas01,ou=Child05' : "XYZ-Gabriel",
}
for o in list_of_choosen_accounts.keys():
text2 = re.sub(r"cn=uidf7021,ou=Child02",o,text1,99999999)
text2 = re.sub(r"Scheer-Schreiber",list_of_choosen_accounts[o],text2,99999999)
text = text + text2
text = text + '''
##########################################################################################################
#################################### GHR
##########################################################################################################
'''
text1 = '''
#add mail to associated GHR record
#
dn: cn=90038190,ou=tempIdent,ou=data,o=conti
changetype: modify
replace: mail
mail: wolfgang.schreiber-ext@continental-corporation.com
-
replace: auxGebMonat
auxGebMonat: 08
-
replace: auxGebTag
auxGebTag: 31
-
replace: auxLOCALEEID
auxLOCALEEID: 00020789
-
'''
#dn: cn=90005772,ou=tempIdent,ou=data,o=conti
#changetype: modify
#replace: auxGebMonat
#auxGebMonat: 01
#-
#replace: auxGebTag
#auxGebTag: 01
#-
#replace: auxLOCALEEID
#auxLOCALEEID: 00020789
#-
list_of_ghr_accounts = [
['90038190','11','28','00030452'],
]
for o in list_of_ghr_accounts:
text2 = re.sub(r"90038190",o[0],text1,99999999)
text2 = re.sub(r"Monat\: 08","Monat: "+o[1],text2,99999999)
text2 = re.sub(r"Tag\: 31","Tag: "+o[2],text2,99999999)
text2 = re.sub(r"ID\: 31","Tag: "+o[3],text2,99999999)
text = text + text2
text = text + '''
##########################################################################################################
#################################### Notes
##########################################################################################################
'''
text1 = '''
# create container for AD test account
#
dn: ou=NotesWs,ou=notes,ou=ident,ou=data,o=conti
changetype: add
objectClass: organizationalUnit
objectClass: ndsLoginProperties
objectClass: Top
objectClass: ndsContainerLoginProperties
ou: NotesWs
# create test user for Notes test account
#
dn: cn=Wolfgang Schreiber,ou=NotesWs,ou=notes,ou=ident,ou=data,o=conti
objectClass: Top
objectClass: ndsLoginProperties
objectClass: Person
objectClass: organizationalPerson
objectClass: DirXML-Identity
objectClass: auxNotesAccount
objectClass: inetOrgPerson
cn: Wolfgang Schreiber
cn: wolfgang.schreiber-ext@continental-corporation.com
cn: wschreibNotes
sn: Schreiber
ACL: 2#subtree#cn=Wolfgang Schreiber,ou=NotesWs,ou=notes,ou=ident,ou=data,o=
conti#[All Attributes Rights]
ACL: 6#entry#cn=Wolfgang Schreiber,ou=NotesWs,ou=notes,ou=ident,ou=data,o=co
nti#loginScript
ACL: 2#entry#[Public]#messageServer
ACL: 2#entry#[Root]#groupMembership
ACL: 6#entry#cn=Wolfgang Schreiber,ou=NotesWs,ou=notes,ou=ident,ou=data,o=co
nti#printJobConfiguration
ACL: 2#entry#[Root]#networkAddress
auxNotesDepartment: WS / Function & SW Development / WS
company: Division: WS / Company: WS
costCenter: R21210
givenName: Wolfgang Notes
mail: Wolfgang.Schreiber@continental-corporation-ws.com
ou: BU Engine Systems / Function & SW Development / P ES SYS CSW CEE
telephoneNumber: +49-941-790-12345
auxNotesPIN: 1234
dn: cn=Wolfgang Schreiber,ou=NotesWs,ou=notes,ou=ident,ou=data,o=conti
changetype: modify
add: userPassword
#userPassword=NetIQ000
userPassword:: TmV0SVEwMDA=
-
#add PIN to associated Notes record
#
dn: cn=Wolfgang Schreiber N2,ou=Notes999,ou=notes,ou=ident,ou=data,o=conti
changetype: modify
add: auxNotesPIN
auxNotesPIN: 1234
-
changetype: modify
replace: givenName
givenName: Wolfgang Notes
-
'''
text2 = text1
text = text + text2
text = text + '''
##########################################################################################################
#################################### SAP
##########################################################################################################
'''
text1 = '''
dn: cn=ALIM,ou=S50-Schreeck,ou=Clients,ou=sap,ou=accts,o=conti
changetype: modify
add: mail
mail: wolfgang.schreiber-ext@continental-corporation.com
-
dn: cn=WSCHREIB,ou=S50,ou=sap,ou=accts,o=conti
changetype: modify
replace: mail
mail: wolfgang.schreiber-ext@continental-corporation.com
-
dn: cn=DHH370,ou=C11-55-Lausch,ou=Clients,ou=sap,ou=accts,o=conti
changetype: modify
add: mail
mail: wolfgang.schreiber-ext@continental-corporation.com
-
dn: cn=Q0MH401,ou=C11-55-Lausch,ou=Clients,ou=sap,ou=accts,o=conti
changetype: modify
add: mail
mail: wolfgang.schreiber-ext@continental-corporation.com
-
dn: cn=FIREFIGHTER0,ou=S50-Schreeck,ou=Clients,ou=sap,ou=accts,o=conti
changetype: modify
add: mail
mail: wolfgang.schreiber-ext@continental-corporation.com
-
dn: cn=FIREFIGHTER0,ou=S50-Schreeck,ou=Clients,ou=sap,ou=accts,o=conti
changetype: modify
# "Sap#12345"
add: userPassword
userPassword:: U2FwIzEyMzQ1
-
#add mail to associate SAP record
#
dn: cn=BEHMEW,ou=S50-Schreeck,ou=Clients,ou=sap,ou=accts,o=conti
changetype: modify
add: mail
mail: wolfgang.schreiber-ext@continental-corporation.com
-
dn: cn=BEHMEW,ou=S50-Schreeck,ou=Clients,ou=sap,ou=accts,o=conti
changetype: modify
# "Sap#12345"
add: userPassword
userPassword:: U2FwIzEyMzQ1
-
dn: cn=UID01006,ou=SAP Sandbox GS1-788,ou=Clients,ou=sap,ou=accts,o=conti
changetype: modify
add: mail
mail: wolfgang.schreiber-ext@continental-corporation.com
-
replace: givenName
givenName: Wolfgang
-
replace: sn
sn: Schreiber-Tester
-
dn: cn=UID01008,ou=SAP Sandbox GS1-788,ou=Clients,ou=sap,ou=accts,o=conti
changetype: modify
add: mail
mail: wolfgang.schreiber-ext@continental-corporation.com
-
replace: givenName
givenName: Wolfgang SAP
-
replace: sn
sn: Schreiber
-
dn: cn=UID25592,ou=SAP Sandbox S50_500,ou=Clients,ou=sap,ou=accts,o=conti
changetype: modify
add: mail
mail: wolfgang.schreiber-ext@continental-corporation.com
-
'''
text2 = text1
text = text + text1
# text = re.sub(r"wolfgang.schreiber-ext\@continental-corporation.com","07_ww_fm_iam_training/usr/cag@conti07",text,99999999)
text = re.sub(r"wolfgang.schreiber-ext\@continental-corporation.com","christian.gabriel-ext@continental-corporation.com",text,99999999)
print text
create_ldif()