def addgroup(name, group):
 name = _cmd_quote(name)
 group = _cmd_quote(group).lstrip("'").rstrip("'")
 user = info(name)
 if (not user):
  return False
 if (group in user['groups']):
  return True
 cmd = 'net localgroup "{0}" {1} /add'.format(group, name)
 ret = __salt__['cmd.run_all'](cmd, python_shell=True)
 return (ret['retcode'] == 0)

def addgroup ( name , group ) : name = _cmd_quote ( name ) group = _cmd_quote ( group ) . lstrip ( "'" ) . rstrip ( "'" ) user = info ( name ) if ( not user ) : return False if ( group in user [ 'groups' ] ) : return True cmd = 'net localgroup "{0}" {1} /add' . format ( group , name ) ret = __salt__ [ 'cmd.run_all' ] ( cmd , python_shell = True ) return ( ret [ 'retcode' ] == 0 )
add user to a group .