I use something like the following to get the groups a user is a member of.
netbios=os.environ["COMPUTERNAME"]
session=domain.create_session_as_computer(netbios)
user_cn="citizenj"
groups=session.find_groups_for_user(user_cn)
Groups variable contains a list of groups with all members of each group.
Is this by design ?
Seems a very heavy query on a large domain with thousands of users in some groups.
I know I can get just the group names by the following
for group in groups:
print (group.distinguished_name)
But is there a way to get just the group names directly without pulling all the members ?
I use something like the following to get the groups a user is a member of.
netbios=os.environ["COMPUTERNAME"]
session=domain.create_session_as_computer(netbios)
user_cn="citizenj"
groups=session.find_groups_for_user(user_cn)
Groups variable contains a list of groups with all members of each group.
Is this by design ?
Seems a very heavy query on a large domain with thousands of users in some groups.
I know I can get just the group names by the following
for group in groups:
print (group.distinguished_name)
But is there a way to get just the group names directly without pulling all the members ?