def is_admin(name):
 groups = get_user_groups(name, True)
 for group in groups:
  if (group in ('S-1-5-32-544', 'S-1-5-18')):
   return True
 return False

def is_admin ( name ) : groups = get_user_groups ( name , True ) for group in groups : if ( group in ( 'S-1-5-32-544' , 'S-1-5-18' ) ) : return True return False
is the passed user a member of the administrators group args: name : the name to check returns: bool: true if user is a member of the administrators group .