def getent(refresh=False):
 if (('group.getent' in __context__) and (not refresh)):
  return __context__['group.getent']
 ret = []
 pythoncom.CoInitialize()
 nt = win32com.client.Dispatch('AdsNameSpaces')
 results = nt.GetObject('', 'WinNT://.')
 results.Filter = ['group']
 for result in results:
  member_list = []
  for member in result.members():
   member_list.append(member.AdsPath.replace('WinNT://', '').replace('/', '\\').encode('ascii', 'backslashreplace'))
  group = {'gid': __salt__['file.group_to_gid'](result.name), 'members': member_list, 'name': result.name, 'passwd': 'x'}
  ret.append(group)
 __context__['group.getent'] = ret
 return ret

def getent ( refresh = False ) : if ( ( 'group.getent' in __context__ ) and ( not refresh ) ) : return __context__ [ 'group.getent' ] ret = [ ] pythoncom . CoInitialize ( ) nt = win32com . client . Dispatch ( 'AdsNameSpaces' ) results = nt . GetObject ( '' , 'WinNT://.' ) results . Filter = [ 'group' ] for result in results : member_list = [ ] for member in result . members ( ) : member_list . append ( member . AdsPath . replace ( 'WinNT://' , '' ) . replace ( '/' , '\\' ) . encode ( 'ascii' , 'backslashreplace' ) ) group = { 'gid' : __salt__ [ 'file.group_to_gid' ] ( result . name ) , 'members' : member_list , 'name' : result . name , 'passwd' : 'x' } ret . append ( group ) __context__ [ 'group.getent' ] = ret return ret
return the list of all info for all users cli example: .