Browse Source

мелкие изменения, тестирую.

master
Mikhail Grebenkin 6 years ago
parent
commit
d0786b2697
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      importer.py

+ 9
- 1
importer.py View File

@ -16,6 +16,14 @@ import zayavka_reader as z_reader
base = "CN=Users,DC=techgrow,DC=local" # можно не заморачиваться с ОУ и тогда base = "CN=Users,DC=myDom,DC=lan"
domainName = 'techgrow.local'
dbconn = {'host': '10.1.11.26',
'user': 'LDAP2018',
'pass': 'Pr4t7UEZITwW1AYG',
'base': 'sitemanager0'}
sql = 'select * from LDAP'
ad_groups = ['vpn-users', 'gogs']
def users_make_ad(sam, base):
expression = "(&(objectCategory=person)(objectClass=user))"
@ -39,7 +47,7 @@ def main():
lp = samba.param.LoadParm()
lp.load(samba.param.default_path()) # или lp.load("/etc/samba/smb.conf")
sam = SamDB(lp=lp, session_info=system_session())
z_users = z_reader.users_make_zayavka()
z_users = z_reader.users_make_zayavka(z_reader.mysql_reader(dbconn, sql), ad_groups)
print len(z_users)
for z_user in z_users:
print z_user


Loading…
Cancel
Save

Powered by TurnKey Linux.