def getGroup(self, search_string):
"""Receives a string and looks for it in directory service. If the
string search isn't found, the message "Group not Found" will be
returned, otherwise a list with all matching cases, limited to 50
results will be returned.
Usage:
>>> users = pe.getGroup('group_name')
"""
groups = []
group = requests.get(self.client.baseurl+'groups',
auth=self.client.cred,
params={'searchPattern':search_string,
'searchType':4, 'limit':3000})
if group.json().get('groups'):
for grp in group.json()['groups']:
groups.append(grp['displayName'])
else:
return "Group not Found"
return groups
评论列表
文章目录