Browse Source

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

master
Mikhail Grebenkin 6 years ago
parent
commit
0e3618ccad
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      UserAd_class.py

+ 2
- 0
UserAd_class.py View File

@ -40,6 +40,8 @@ class UserAd:
expression = "(&(objectCategory=person)(objectClass=user)(sAMAccountName=%s))" % self.usrName
res = self.sam.search(base=base, expression=expression, attrs=['memberOf'])
groups = []
if len(res) == 0:
return groups
for k in res[0]['memberOf']:
groups.append(str(k).split(',')[0].split('=')[1])
return groups


Loading…
Cancel
Save

Powered by TurnKey Linux.