Ejemplo n.º 1
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import datetime
import sys
import os
from pprint import pprint
from clacks.agent.objects import ObjectFactory

f = ObjectFactory()
p = f.getObject('SambaDomain', u'sambaDomainName=FabianSuperDomain,sambaDomainName=GONICUS,dc=gonicus,dc=de', mode='remove')

for entry in p.listProperties():
    print "%30s" % (entry,), getattr(p, entry)

#p.commit()
p.remove();
Ejemplo n.º 2
0
import os
from pprint import pprint
from clacks.agent.objects import ObjectFactory


f = ObjectFactory()

## Update

cn = u"hickert-test4"

object_type, extensions =  f.identifyObject(u'cn=%s,ou=groups,dc=gonicus,dc=de' % (cn,))

print object_type, extensions

p = f.getObject('PosixGroup', u'cn=%s,ou=groups,dc=gonicus,dc=de' % (cn,), mode='update')
for entry in p.listProperties():
    print "%30s" % (entry,), getattr(p, entry)

p.memberUid= [u"hickert"]
p.gidNumber = -1
p.commit()

p = f.getObject('SambaGroup', u'cn=%s,ou=groups,dc=gonicus,dc=de' % (cn,), mode='update')
p.sambaGroupType = 513
p.sambaGroupType = 514
p.sambaDomainName = "WINNT-TEST"
p.commit()

#p = f.getObject('PosixGroup', u'ou=groups,dc=gonicus,dc=de', mode='create')
#p.cn = cn
Ejemplo n.º 3
0
from pprint import pprint
from clacks.agent.objects import ObjectFactory


f = ObjectFactory()

## Update
object_type, extensions =  f.identifyObject(u'cn=Playground Tester,ou=people,dc=gonicus,dc=de')

# Add or remove samba
#if not 'SambaUser' in extensions:
#    p = f.getObject('SambaUser', u'cn=Playground Tester,ou=people,dc=gonicus,dc=de', mode='extend')
#    p.sambaSID = "11111111"
#    p.commit()
#    print "Extending!"
#
#else:
#    p = f.getObject('SambaUser', u'cn=Playground Tester,ou=people,dc=gonicus,dc=de')
#    p.retract()
#    print "Retracting!"

p = f.getObject('SambaUser', u'cn=Playground Tester,ou=people,dc=gonicus,dc=de', mode='update')
for entry in p.listProperties():
    print "%30s" % (entry,), getattr(p, entry)

p = f.getObject('SambaUser', u'cn=Playground Tester,ou=people,dc=gonicus,dc=de', mode='update')
p.sambaSID = "1111222"
p.CtxKeyboardLayout = ""
p.sambaDomainName = u"tester"
p.commit()
Ejemplo n.º 4
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import datetime
import sys
import os
from pprint import pprint
from clacks.agent.objects import ObjectFactory


f = ObjectFactory()

## Update
object_type, extensions =  f.identifyObject(u'cn=Playground Tester,ou=people,dc=gonicus,dc=de')

p = f.getObject('PosixUser', u'cn=Playground Tester,ou=people,dc=gonicus,dc=de', mode='update')
for entry in p.listProperties():
    print "%30s" % (entry,), getattr(p, entry)


# Add or remove samba
if not 'PosixUser' in extensions:
    p = f.getObject('PosixUser', u'cn=Playground Tester,ou=people,dc=gonicus,dc=de', mode='extend')
    p.homeDirectory = "\home\hickert"
    p.gidNumber = 231
    p.commit()
    print "Extending!"

else:
    p = f.getObject('PosixUser', u'cn=Playground Tester,ou=people,dc=gonicus,dc=de')
    p.retract()