original_docstring: r'''
      Updates settings for the windows user. Name is the only required parameter.
      Settings will only be changed if the parameter is passed a value.
  
      .. versionadded:: 2015.8.0
  
      :param name: str
      The user name to update.
  
      :param password: str
      New user password in plain text.
  
      :param fullname: str
      The user's full name.
  
      :param description: str
      A brief description of the user account.
  
      :param home: str
      The path to the user's home directory.
  
      :param homedrive: str
      The drive letter to assign to the home directory. Must be the Drive Letter
      followed by a colon. ie: U:
  
      :param logonscript: str
      The path to the logon script.
  
      :param profile: str
      The path to the user's profile directory.
  
      :return: bool
      True if successful. False is unsuccessful.
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' user.update bob password=secret profile=C:\Users\Bob
                   home=\\server\homeshare\bob homedrive=U:
      
docstring: r'''
  Updates settings for the windows user. Name is the only required parameter.
  Settings will only be changed if the parameter is passed a value.
  
  
docstring_tokens: r ' ' ' Updates settings for the windows user . Name is the only required parameter . Settings will only be changed if the parameter is passed a value .
code: def update(name,
             password=None,
             fullname=None,
             description=None,
             home=None,
             homedrive=None,
             logonscript=None,
             profile=None):
      r'''
      Updates settings for the windows user. Name is the only required parameter.
      Settings will only be changed if the parameter is passed a value.
  
      .. versionadded:: 2015.8.0
  
      :param name: str
      The user name to update.
  
      :param password: str
      New user password in plain text.
  
      :param fullname: str
      The user's full name.
  
      :param description: str
      A brief description of the user account.
  
      :param home: str
      The path to the user's home directory.
  
      :param homedrive: str
      The drive letter to assign to the home directory. Must be the Drive Letter
      followed by a colon. ie: U:
  
      :param logonscript: str
      The path to the logon script.
  
      :param profile: str
      The path to the user's profile directory.
  
      :return: bool
      True if successful. False is unsuccessful.
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' user.update bob password=secret profile=C:\Users\Bob
                   home=\\server\homeshare\bob homedrive=U:
      '''
  
      # Make sure the user exists
      # Return an object containing current settings for the user
      try:
          user_info = win32net.NetUserGetInfo(None, name, 4)
      except win32net.error as exc:
          (number, context, message) = exc
          log.error('Failed to update user {0}'.format(name))
          log.error('nbr: {0}'.format(number))
          log.error('ctx: {0}'.format(context))
          log.error('msg: {0}'.format(message))
          return False
  
      # Check parameters to update
      # Update the user object with new settings
      if password:
          user_info['password'] = password
      if home:
          user_info['home_dir'] = home
      if homedrive:
          user_info['home_dir_drive'] = homedrive
      if description:
          user_info['comment'] = description
      if logonscript:
          user_info['script_path'] = logonscript
      if fullname:
          user_info['full_name'] = fullname
      if profile:
          user_info['profile'] = profile
  
      # Apply new settings
      try:
          win32net.NetUserSetInfo(None, name, 4, user_info)
      except win32net.error as exc:
          (number, context, message) = exc
          log.error('Failed to update user {0}'.format(name))
          log.error('nbr: {0}'.format(number))
          log.error('ctx: {0}'.format(context))
          log.error('msg: {0}'.format(message))
          return False
  
      return True
code_tokens: def update ( name , password = None , fullname = None , description = None , home = None , homedrive = None , logonscript = None , profile = None ) : try : user_info = win32net . NetUserGetInfo ( None , name , 4 ) except win32net . error as exc : ( number , context , message ) = exc log . error ( 'Failed to update user {0}' . format ( name ) ) log . error ( 'nbr: {0}' . format ( number ) ) log . error ( 'ctx: {0}' . format ( context ) ) log . error ( 'msg: {0}' . format ( message ) ) return False if password : user_info [ 'password' ] = password if home : user_info [ 'home_dir' ] = home if homedrive : user_info [ 'home_dir_drive' ] = homedrive if description : user_info [ 'comment' ] = description if logonscript : user_info [ 'script_path' ] = logonscript if fullname : user_info [ 'full_name' ] = fullname if profile : user_info [ 'profile' ] = profile try : win32net . NetUserSetInfo ( None , name , 4 , user_info ) except win32net . error as exc : ( number , context , message ) = exc log . error ( 'Failed to update user {0}' . format ( name ) ) log . error ( 'nbr: {0}' . format ( number ) ) log . error ( 'ctx: {0}' . format ( context ) ) log . error ( 'msg: {0}' . format ( message ) ) return False return True
short_docstring: r'''
  Updates settings for the windows user.
short_docstring_tokens: r ' ' ' Updates settings for the windows user .
comment: r'''
      Updates settings for the windows user. Name is the only required parameter.
      Settings will only be changed if the parameter is passed a value.
  
      .. versionadded:: 2015.8.0
  
      :param name: str
      The user name to update.
  
      :param password: str
      New user password in plain text.
  
      :param fullname: str
      The user's full name.
  
      :param description: str
      A brief description of the user account.
  
      :param home: str
      The path to the user's home directory.
  
      :param homedrive: str
      The drive letter to assign to the home directory. Must be the Drive Letter
      followed by a colon. ie: U:
  
      :param logonscript: str
      The path to the logon script.
  
      :param profile: str
      The path to the user's profile directory.
  
      :return: bool
      True if successful. False is unsuccessful.
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' user.update bob password=secret profile=C:\Users\Bob
                   home=\\server\homeshare\bob homedrive=U:
      '''$SEP$# Make sure the user exists$SEP$# Return an object containing current settings for the user$SEP$# Check parameters to update$SEP$# Update the user object with new settings$SEP$# Apply new settings