neulab/tldr huggingface dataset:
Returns A dictionary containing the task configuration
salt 'minion-id' task.add_action <task_name> cmd='del /Q /S C:\\Temp'
salt.modules.win_task.add_trigger(name=None, location='\\', trigger_type=None, trigger_enabled=True, start_date=None, start_time=None, end_date=None, end_time=None, random_delay=None, repeat_interval=None, repeat_duration=None, repeat_stop_at_duration_end=False, execution_time_limit=None, delay=None, **kwargs) Add a trigger to a Windows Scheduled task
NOTE: Arguments are parsed by the YAML loader and are subject to yaml's idiosyncrasies. Therefore, time values in some formats (%H:%M:%S and %H:%M) should to be quoted.  See YAML IDIOSYNCRASIES for more details.
• name (str) -- The name of the task to which to add the trigger.
• trigger_type (str) --
The type of trigger to create. This is defined when the trigger is created and cannot be changed later. Options are as follows:
• Event
• Once
• Daily
• Weekly
• Monthly
• MonthlyDay
• OnIdle
• OnTaskCreation
• OnBoot
• OnLogon
• OnSessionChange
• trigger_enabled (bool) -- Boolean value that indicates whether the trigger is enabled.
• start_date (str) --
The date when the trigger is activated. If no value is passed, the current date will be used. Can be one of the following formats:
• %Y-%m-%d
• %m-%d-%y
• %m-%d-%Y
• %Y/%m/%d
• start_time (str) --
The time when the trigger is activated. If no value is passed, midnight will be used. Can be one of the following formats:
• %I:%M:%S %p
• %I:%M %p
• %H:%M:%S
• %H:%M
• end_date (str) --
The date when the trigger is deactivated. The trigger cannot start the task after it is deactivated. Can be one of the following formats:
• end_time (str) --
The time when the trigger is deactivated. If this is not passed with end_date it will be set to midnight. Can be one of the following formats:
• random_delay (str) --
The delay time that is randomly added to the start time of the trigger. Valid values are:
• 30 seconds
• 1 minute
• 30 minutes
• 8 hours
• 1 day
NOTE: This parameter applies to the following trigger types
• repeat_interval (str) --
The amount of time between each restart of the task. Valid values are:
• 5 minutes
• 10 minutes
• 15 minutes
• repeat_duration (str) --
How long the pattern is repeated. Valid values are:
• Indefinitely
• 12 hours
• repeat_stop_at_duration_end (bool) -- Boolean value that indicates if a running instance of the task is stopped at the end of the repetition pattern duration.
• execution_time_limit (str) --
The maximum amount of time that the task launched by the trigger is allowed to run. Valid values are:
• 2 hours
• 4 hours
• 3 days (default)
• delay (str) --
The time the trigger waits after its activation to start the task.  Valid values are:
• 15 seconds
NOTE: This parameter applies to the following trigger types:
There are optional keyword arguments determined by the type of trigger being defined. They are as follows:
Event The trigger will be fired by an event.
subscription (str): An event definition in xml format that fires the trigger. The easiest way to get this would is to create an event in Windows Task Scheduler and then copy the xml text.
Once No special parameters required.
Daily The task will run daily.
days_interval (int): The interval between days in the schedule. An interval of 1 produces a daily schedule. An interval of 2 produces an every-other day schedule. If no interval is specified, 1 is used. Valid entries are 1 - 999.
Weekly The task will run weekly.
weeks_interval (int): The interval between weeks in the schedule. An interval of 1 produces a weekly schedule. An interval of 2 produces an every-other week schedule. If no interval is specified, 1 is used. Valid entries are 1 - 52.
days_of_week (list): Sets the days of the week on which the task runs. Should be a list. ie: ['Monday','Wednesday','Friday']. Valid entries are the names of the days of the week.
Monthly The task will run monthly.
months_of_year (list): Sets the months of the year during which the task runs. Should be a list. ie: ['January','July']. Valid entries are the full names of all the months.
days_of_month (list): Sets the days of the month during which the task runs. Should be a list. ie: [1, 15, 'Last']. Options are all days of the month 1 - 31 and the word 'Last' to indicate the last day of the month.
last_day_of_month (bool): Boolean value that indicates that the task runs on the last day of the month regardless of the actual date of that day.
NOTE: You can set the task to run on the last day of the month by either including the word 'Last' in the list of days, or setting the parameter 'last_day_of_month' equal to True.
MonthlyDay The task will run monthly on the specified day.
weeks_of_month (list): Sets the weeks of the month during which the task runs. Should be a list. ie: ['First','Third']. Valid options are:
• First
• Second
• Third
• Fourth
last_week_of_month (bool): Boolean value that indicates that the task runs on the last week of the month.
days_of_week (list): Sets the days of the week during which the task runs. Should be a list. ie: ['Monday','Wednesday','Friday'].  Valid entries are the names of the days of the week.
OnIdle No special parameters required.
OnTaskCreation No special parameters required.
OnBoot No special parameters required.
OnLogon No special parameters required.
OnSessionChange The task will be triggered by a session change.
session_user_name (str): Sets the user for the Terminal Server session. When a session state change is detected for this user, a task is started. To detect session status change for any user, do not pass this parameter.
state_change (str): Sets the kind of Terminal Server session change that would trigger a task launch. Valid options are:
• ConsoleConnect: When you connect to a user session (switch users)
• ConsoleDisconnect: When you disconnect a user session (switch users)
• RemoteConnect: When a user connects via Remote Desktop
• RemoteDisconnect: When a user disconnects via Remote Desktop
• SessionLock: When the workstation is locked
• SessionUnlock: When the workstation is unlocked
salt 'minion-id' task.add_trigger <task_name> trigger_type=Once trigger_enabled=True start_date=2016/12/1 start_time='"12:01"'
salt.modules.win_task.clear_triggers(name, location='\\') Remove all triggers from the task.
• name (str) -- The name of the task from which to clear all triggers.
salt 'minion-id' task.clear_trigger <task_name>
salt.modules.win_task.create_folder(name, location='\\') Create a folder in which to create tasks.
• name (str) -- The name of the folder. This will be displayed in the task scheduler.
• location (str) -- A string value representing the location in which to create the folder. Default is \ which is the root for the task scheduler (C:\Windows\System32\tasks).
salt 'minion-id' task.create_folder <folder_name>
salt.modules.win_task.create_task(name, location='\\', user_name='System', password=None, force=False, **kwargs) Create a new task in the designated location. This function has many keyword arguments that are not listed here. For additional arguments see:
• edit_task()
• add_action()
• add_trigger()
• name (str) -- The name of the task. This will be displayed in the task scheduler.
• location (str) -- A string value representing the location in which to create the task. Default is \ which is the root for the task scheduler (C:\Windows\System32\tasks).
• user_name (str) -- The user account under which to run the task. To specify the 'System' account, use 'System'. The password will be ignored.
• password (str) -- The password to use for authentication. This should set the task to run whether the user is logged in or not, but is currently not working.
• force (bool) -- If the task exists, overwrite the existing task.
salt 'minion-id' task.create_task <task_name> user_name=System force=True action_type=Execute cmd='del /Q /S C:\\Temp' trigger_type=Once start_date=2016-12-1 start_time=01:00
salt.modules.win_task.create_task_from_xml(name, location='\\', xml_text=None, xml_path=None, user_name='System', password=None) Create a task based on XML. Source can be a file or a string of XML.
• xml_text (str) -- A string of xml representing the task to be created. This will be overridden by xml_path if passed.
• xml_path (str) -- The path to an XML file on the local system containing the xml that defines the task. This will override xml_text
Returns True if successful, otherwise False str: A string with the error message if there is an error
• ArgumentValueError -- If arguments are invalid
• CommandExecutionError --
salt '*' task.create_task_from_xml <task_name> xml_path=C:\task.xml
salt.modules.win_task.delete_folder(name, location='\\') Delete a folder from the task scheduler.
• name (str) -- The name of the folder to delete.
• location (str) -- A string value representing the location of the folder.  Default is \ which is the root for the task scheduler (C:\Windows\System32\tasks).
salt 'minion-id' task.delete_folder <folder_name>
salt.modules.win_task.delete_task(name, location='\\') Delete a task from the task scheduler.
• name (str) -- The name of the task to delete.
salt 'minion-id' task.delete_task <task_name>
salt.modules.win_task.edit_task(name=None, location='\\', user_name=None, password=None, description=None, enabled=None, hidden=None, run_if_idle=None, idle_duration=None, idle_wait_timeout=None, idle_stop_on_end=None, idle_restart=None, ac_only=None, stop_if_on_batteries=None, wake_to_run=None, run_if_network=None, network_id=None, network_name=None, allow_demand_start=None, start_when_available=None, restart_every=None, restart_count=3, execution_time_limit=None, force_stop=None, delete_after=None, multiple_instances=None, **kwargs) Edit the parameters of a task. Triggers and Actions cannot be edited yet.
The password to use for authentication. This should set the task to run whether the user is logged in or not, but is currently not working.
NOTE: The combination of user_name and password determine how the task runs. For example, if a username is passed without at password the task will only run when the user is logged in. If a password is passed as well the task will run whether the user is logged on or not. If you pass 'System' as the username the task will run as the system account (the password parameter is ignored).
• description (str) -- A string representing the text that will be displayed in the description field in the task scheduler.
• enabled (bool) -- A boolean value representing whether or not the task is enabled.
• hidden (bool) -- A boolean value representing whether or not the task is hidden.
• run_if_idle (bool) -- Boolean value that indicates that the Task Scheduler will run the task only if the computer is in an idle state.
• idle_duration (str) --
A value that indicates the amount of time that the computer must be in an idle state before the task is run. Valid values are:
• idle_wait_timeout (str) --
A value that indicates the amount of time that the Task Scheduler will wait for an idle condition to occur. Valid values are:
• Do not wait
• idle_stop_on_end (bool) -- Boolean value that indicates that the Task Scheduler will terminate the task if the idle condition ends before the task is completed.
• idle_restart (bool) -- Boolean value that indicates whether the task is restarted when the computer cycles into an idle condition more than once.
• ac_only (bool) -- Boolean value that indicates that the Task Scheduler will launch the task only while on AC power.
• stop_if_on_batteries (bool) -- Boolean value that indicates that the task will be stopped if the computer begins to run on battery power.
• wake_to_run (bool) -- Boolean value that indicates that the Task Scheduler will wake the computer when it is time to run the task.
• run_if_network (bool) -- Boolean value that indicates that the Task Scheduler will run the task only when a network is available.
• network_id (guid) -- GUID value that identifies a network profile.
• network_name (str) -- Sets the name of a network profile. The name is used for display purposes.
• allow_demand_start (bool) -- Boolean value that indicates that the task can be started by using either the Run command or the Context menu.
• start_when_available (bool) -- Boolean value that indicates that the Task Scheduler can start the task at any time after its scheduled time has passed.
• restart_every (str) --
A value that specifies the interval between task restart attempts.  Valid values are:
• False (to disable)
• restart_count (int) -- The number of times the Task Scheduler will attempt to restart the task. Valid values are integers 1 - 999.
• execution_time_limit (bool, str) --
The amount of time allowed to complete the task. Valid values are:
• 3 days
• force_stop (bool) -- Boolean value that indicates that the task may be terminated by using TerminateProcess.
• delete_after (bool, str) --
The amount of time that the Task Scheduler will wait before deleting the task after it expires. Requires a trigger with an expiration date. Valid values are:
• Immediately
• 30 days
• 90 days
• 180 days
• 365 days
• multiple_instances (str) --
Sets the policy that defines how the Task Scheduler deals with multiple instances of the task. Valid values are:
• Parallel
• Queue
• No New Instance
• Stop Existing
salt '*' task.edit_task <task_name> description='This task is awesome'
salt.modules.win_task.info(name, location='\\') Get the details about a task in the task scheduler.
• name (str) -- The name of the task for which to return the status
salt 'minion-id' task.info <task_name>
salt.modules.win_task.list_actions(name, location='\\') List all actions that pertain to a task in the specified location.
• name (str) -- The name of the task for which list actions.
• location (str) -- A string value representing the location of the task from which to list actions. Default is \ which is the root for the task scheduler (C:\Windows\System32\tasks).
Returns Returns a list of actions.
# List all actions for a task in the default location salt 'minion-id' task.list_actions <task_name>
# List all actions for the XblGameSaveTask in the Microsoft\XblGameSave # location salt 'minion-id' task.list_actions XblGameSaveTask Microsoft\XblGameSave
salt.modules.win_task.list_folders(location='\\') List all folders located in a specific location in the task scheduler.
Parameters location (str) -- A string value representing the folder from which you want to list tasks. Default is \ which is the root for the task scheduler (C:\Windows\System32\tasks).
Returns Returns a list of folders.
# List all folders in the default location salt 'minion-id' task.list_folders
# List all folders in the Microsoft directory salt 'minion-id' task.list_folders Microsoft
salt.modules.win_task.list_tasks(location='\\') List all tasks located in a specific location in the task scheduler.
Returns Returns a list of tasks
# List all tasks in the default location salt 'minion-id' task.list_tasks
# List all tasks in the Microsoft\XblGameSave Directory salt 'minion-id' task.list_tasks Microsoft\XblGameSave
salt.modules.win_task.list_triggers(name, location='\\') List all triggers that pertain to a task in the specified location.
• name (str) -- The name of the task for which list triggers.
• location (str) -- A string value representing the location of the task from which to list triggers. Default is \ which is the root for the task scheduler (C:\Windows\System32\tasks).
Returns Returns a list of triggers.
# List all triggers for a task in the default location salt 'minion-id' task.list_triggers <task_name>
# List all triggers for the XblGameSaveTask in the Microsoft\XblGameSave # location salt '*' task.list_triggers XblGameSaveTask Microsoft\XblGameSave
salt.modules.win_task.run(name, location='\\') Run a scheduled task manually.
• name (str) -- The name of the task to run.
salt 'minion-id' task.run <task_name>
salt.modules.win_task.run_wait(name, location='\\') Run a scheduled task and return when the task finishes
salt 'minion-id' task.run_wait <task_name>
salt.modules.win_task.status(name, location='\\') Determine the status of a task. Is it Running, Queued, Ready, etc.
Returns The current status of the task. Will be one of the following:
• Unknown
• Queued
• Ready
• Running
salt 'minion-id' task.list_status <task_name>
salt.modules.win_task.stop(name, location='\\') Stop a scheduled task.
• name (str) -- The name of the task to stop.
salt 'minion-id' task.list_stop <task_name>
salt.modules.win_timezone Module for managing timezone on Windows systems.
class salt.modules.win_timezone.TzMapper(unix_to_win)
add(k, v)
get_unix(key, default=None)
get_win(key, default=None)
list_unix()
list_win()
remove(k)
salt.modules.win_timezone.get_hwclock() Get current hardware clock setting (UTC or localtime)
NOTE: The hardware clock is always local time on Windows so this will always return "localtime"
salt.modules.win_timezone.get_offset() Get current numeric timezone offset from UTC (i.e. -0700)
Returns Offset from UTC
salt.modules.win_timezone.get_zone() Get current timezone (i.e. America/Denver)
Returns Timezone in unix format
Raises CommandExecutionError -- If timezone could not be gathered
salt.modules.win_timezone.get_zonecode() Get current timezone (i.e. PST, MDT, etc)
Returns An abbreviated timezone code
salt.modules.win_timezone.list(unix_style=True) Return a list of Timezones that this module supports. These can be in either Unix or Windows format.
Parameters unix_style (bool) -- True returns Unix-style timezones. False returns Windows-style timezones. Default is True
Returns A list of supported timezones
# Unix-style timezones salt '*' timezone.list
# Windows-style timezones salt '*' timezone.list unix_style=False
salt.modules.win_timezone.set_hwclock(clock) Sets the hardware clock to be either UTC or localtime
NOTE: The hardware clock is always local time on Windows so this will always return False
salt.modules.win_timezone.set_zone(timezone) Sets the timezone using the tzutil.
Parameters timezone (str) -- A valid timezone
Raises CommandExecutionError -- If invalid timezone is passed
salt.modules.win_timezone.zone_compare(timezone) Compares the given timezone with the machine timezone. Mostly useful for running state checks.
Parameters timezone (str) -- The timezone to compare. This can be in Windows or Unix format. Can be any of the values returned by the timezone.list function
Returns True if they match, otherwise False
salt.modules.win_useradd Module for managing Windows Users.
• win32netcon
• win32profile
• win32security
• win32ts
NOTE: This currently only works with local user accounts, not domain accounts
salt.modules.win_useradd.add(name, password=None, fullname=None, description=None, groups=None, home=None, homedrive=None, profile=None, logonscript=None) Add a user to the minion.
• name (str) -- User name
• password (str, optional) -- User's password in plain text.
• fullname (str, optional) -- The user's full name.
• description (str, optional) -- A brief description of the user account.
• groups (str, optional) -- A list of groups to add the user to.  (see chgroups)
• home (str, optional) -- The path to the user's home directory.
• homedrive (str, optional) -- The drive letter to assign to the home directory. Must be the Drive Letter followed by a colon. ie: U:
• profile (str, optional) -- An explicit path to a profile. Can be a UNC or a folder on the system. If left blank, windows uses its default profile directory.
• logonscript (str, optional) -- Path to a login script to run when the user logs on.
Returns True if successful. False is unsuccessful.
salt '*' user.add name password
salt.modules.win_useradd.addgroup(name, group) Add user to a group
• name (str) -- The user name to add to the group
• group (str) -- The name of the group to which to add the user
salt '*' user.addgroup jsnuffy 'Power Users'
salt.modules.win_useradd.chfullname(name, fullname) Change the full name of the user
• name (str) -- The user name for which to change the full name
• fullname (str) -- The new value for the full name
salt '*' user.chfullname user 'First Last'
salt.modules.win_useradd.chgroups(name, groups, append=True) Change the groups this user belongs to, add append=False to make the user a member of only the specified groups
• name (str) -- The user name for which to change groups
• groups (str, list) -- A single group or a list of groups to assign to the user. For multiple groups this can be a comma delimited string or a list.
• append (bool, optional) -- True adds the passed groups to the user's current groups. False sets the user's groups to the passed groups only. Default is True.
salt '*' user.chgroups jsnuffy Administrators,Users True
salt.modules.win_useradd.chhome(name, home, **kwargs) Change the home directory of the user, pass True for persist to move files to the new home directory if the old home directory exist.
• name (str) -- The name of the user whose home directory you wish to change
• home (str) -- The new location of the home directory
salt '*' user.chhome foo \\fileserver\home\foo True
salt.modules.win_useradd.chprofile(name, profile) Change the profile directory of the user
• name (str) -- The name of the user whose profile you wish to change
• profile (str) -- The new location of the profile
salt '*' user.chprofile foo \\fileserver\profiles\foo
salt.modules.win_useradd.current(sam=False) Get the username that salt-minion is running under. If salt-minion is running as a service it should return the Local System account. If salt is running from a command prompt it should return the username that started the command prompt.
Parameters sam (bool, optional) -- False returns just the username without any domain notation. True returns the domain with the username in the SAM format. Ie: domain\username
Returns Returns username
salt '*' user.current
salt.modules.win_useradd.delete(name, purge=False, force=False) Remove a user from the minion
• name (str) -- The name of the user to delete
• purge (bool, optional) -- Boolean value indicating that the user profile should also be removed when the user account is deleted. If set to True the profile will be removed. Default is False.
• force (bool, optional) -- Boolean value indicating that the user account should be deleted even if the user is logged in. True will log the user out and delete user.
salt '*' user.delete name
salt.modules.win_useradd.getUserSid(username) Get the Security ID for the user
Parameters username (str) -- The user name for which to look up the SID
Returns The user SID
salt '*' user.getUserSid jsnuffy
salt.modules.win_useradd.getent(refresh=False) Return the list of all info for all users
Parameters refresh (bool, optional) -- Refresh the cached user information. Useful when used from within a state function. Default is False.
Returns A dictionary containing information about all users on the system
salt.modules.win_useradd.info(name) Return user information
Parameters name (str) -- Username for which to display information
A dictionary containing user information
• fullname
• SID
• passwd (will always return None)
• comment (same as description, left here for backwards compatibility)
• active
• logonscript
• home
• homedrive
• groups
• password_changed
• successful_logon_attempts
• failed_logon_attempts
• last_logon
• account_disabled
• account_locked
• password_never_expires
• disallow_change_password
• gid
salt '*' user.info jsnuffy
salt.modules.win_useradd.list_groups(name) Return a list of groups the named user belongs to
Parameters name (str) -- The user name for which to list groups
Returns A list of groups to which the user belongs
salt.modules.win_useradd.list_users() Return a list of all users on Windows
Returns A list of all users on the system
salt.modules.win_useradd.removegroup(name, group) Remove user from a group
• name (str) -- The user name to remove from the group
• group (str) -- The name of the group from which to remove the user
salt '*' user.removegroup jsnuffy 'Power Users'
salt.modules.win_useradd.rename(name, new_name) Change the username for a named user
• name (str) -- The user name to change
• new_name (str) -- The new name for the current user
salt '*' user.rename jsnuffy jshmoe
salt.modules.win_useradd.setpassword(name, password) Set the user's password
• name (str) -- The user name for which to set the password
salt '*' user.setpassword jsnuffy sup3rs3cr3t
salt.modules.win_useradd.update(name, password=None, fullname=None, description=None, home=None, homedrive=None, logonscript=None, profile=None, expiration_date=None, expired=None, account_disabled=None, unlock_account=None, password_never_expires=None, disallow_change_password=None) Updates settings for the windows user. Name is the only required parameter.  Settings will only be changed if the parameter is passed a value.
• name (str) -- The user name to update.
• password (str, optional) -- New user password in plain text.
• logonscript (str, optional) -- The path to the logon script.
• profile (str, optional) -- The path to the user's profile directory.
• expiration_date (date, optional) -- The date and time when the account expires. Can be a valid date/time string. To set to never expire pass the string 'Never'.
• expired (bool, optional) -- Pass True to expire the account. The user will be prompted to change their password at the next logon. Pass False to mark the account as 'not expired'. You can't use this to negate the expiration if the expiration was caused by the account expiring. You'll have to change the expiration_date as well.
• account_disabled (bool, optional) -- True disables the account. False enables the account.
• unlock_account (bool, optional) -- True unlocks a locked user account.  False is ignored.
• password_never_expires (bool, optional) -- True sets the password to never expire. False allows the password to expire.
• disallow_change_password (bool, optional) -- True blocks the user from changing the password. False allows the user to change the password.
salt '*' user.update bob password=secret profile=C:\Users\Bob home=\server\homeshare\bob homedrive=U:
salt.modules.win_wua Module for managing Windows Updates using the Windows Update Agent.
List updates on the system using the following functions:
• win_wua.available
• win_wua.list
This is an easy way to find additional information about updates available to to the system, such as the GUID, KB number, or description.
Once you have the GUID or a KB number for the update you can get information about the update, download, install, or uninstall it using these functions:
• win_wua.get
• win_wua.download
• win_wua.install
• win_wua.uninstall
The get function expects a name in the form of a GUID, KB, or Title and should return information about a single update. The other functions accept either a single item or a list of items for downloading/installing/uninstalling a specific list of items.
The win_wua.list and win_wua.get functions are utility functions. In addition to returning information about updates they can also download and install updates by setting download=True or install=True.  So, with py:func:win_wua.list <salt.modules.win_wua.list_> for example, you could run the function with the filters you want to see what is available. Then just add install=True to install everything on that list.
If you want to download, install, or uninstall specific updates, use win_wua.download, win_wua.install, or win_wua.uninstall. To update your system with the latest updates use win_wua.list and set install=True
You can also adjust the Windows Update settings using the win_wua.set_wu_settings function. This function is only supported on the following operating systems:
• Windows Vista / Server 2008
• Windows 7 / Server 2008R2
• Windows 8 / Server 2012
• Windows 8.1 / Server 2012R2
As of Windows 10 and Windows Server 2016, the ability to modify the Windows Update settings has been restricted. The settings can be modified in the Local Group Policy using the lgpo module.
depends salt.utils.win_update
salt.modules.win_wua.available(software=True, drivers=True, summary=False, skip_installed=True, skip_hidden=True, skip_mandatory=False, skip_reboot=False, categories=None, severities=None, online=True) New in version 2017.7.0.
List updates that match the passed criteria. This allows for more filter options than list(). Good for finding a specific GUID or KB.
• software (bool) -- Include software updates in the results. Default is True
• drivers (bool) -- Include driver updates in the results. Default is True
• summary (bool) -- .INDENT 2.0
• True: Return a summary of updates available for each category.
• False (default): Return a detailed list of available updates.
• skip_installed (bool) -- Skip updates that are already installed. Default is True
• skip_hidden (bool) -- Skip updates that have been hidden. Default is True
• skip_mandatory (bool) -- Skip mandatory updates. Default is False
• skip_reboot (bool) -- Skip updates that require a reboot. Default is False
• categories (list) --
Specify the categories to list. Must be passed as a list. All categories returned by default.
Categories include the following:
• Critical Updates
• Definition Updates
• Drivers (make sure you set drivers=True)
• Feature Packs
• Security Updates
• Update Rollups
• Updates
• Windows 7
• Windows 8.1
• Windows 8.1 drivers
• Windows 8.1 and later drivers
• Windows Defender
• severities (list) --
Specify the severities to include. Must be passed as a list. All severities returned by default.
Severities include the following:
• Critical
• Important
• online (bool) --
Tells the Windows Update Agent go online to update its local update database. True will go online. False will use the local update database as is. Default is True
Returns Returns a dict containing either a summary or a list of updates:
Dict of Updates: {'<GUID>': { 'Title': <title>, 'KB': <KB>, 'GUID': <the globally unique identifier for the update>, 'Description': <description>, 'Downloaded': <has the update been downloaded>, 'Installed': <has the update been installed>, 'Mandatory': <is the update mandatory>, 'UserInput': <is user input required>, 'EULAAccepted': <has the EULA been accepted>, 'Severity': <update severity>, 'NeedsReboot': <is the update installed and awaiting reboot>, 'RebootBehavior': <will the update require a reboot>, 'Categories': [ '<category 1>', '<category 2>', ... ] }}
Summary of Updates: {'Total': <total number of updates returned>, 'Available': <updates that are not downloaded or installed>, 'Downloaded': <updates that are downloaded but not installed>, 'Installed': <updates installed (usually 0 unless installed=True)>, 'Categories': { <category 1>: <total for that category>, <category 2>: <total for category 2>, ... } }
# Normal Usage (list all software updates) salt '*' win_wua.available
# List all updates with categories of Critical Updates and Drivers salt '*' win_wua.available categories=["Critical Updates","Drivers"]
# List all Critical Security Updates salt '*' win_wua.available categories=["Security Updates"] severities=["Critical"]
# List all updates with a severity of Critical salt '*' win_wua.available severities=["Critical"]
# A summary of all available updates salt '*' win_wua.available summary=True
# A summary of all Feature Packs and Windows 8.1 Updates salt '*' win_wua.available categories=["Feature Packs","Windows 8.1"] summary=True
salt.modules.win_wua.download(names) New in version 2017.7.0.
Downloads updates that match the list of passed identifiers. It's easier to use this function by using list_updates and setting download=True.
Parameters names (str, list) --
A single update or a list of updates to download. This can be any combination of GUIDs, KB numbers, or names. GUIDs or KBs are preferred.
NOTE: An error will be raised if there are more results than there are items in the names parameter
Returns A dictionary containing the details about the downloaded updates
# Normal Usage salt '*' win_wua.download names=['12345678-abcd-1234-abcd-1234567890ab', 'KB2131233']
salt.modules.win_wua.get(name, download=False, install=False, online=True) New in version 2017.7.0.
Returns details for the named update
• name (str) -- The name of the update you're searching for. This can be the GUID, a KB number, or any part of the name of the update. GUIDs and KBs are preferred. Run list to get the GUID for the update you're looking for.
• download (bool) -- Download the update returned by this function. Run this function first to see if the update exists, then set download=True to download the update.
• install (bool) -- Install the update returned by this function. Run this function first to see if the update exists, then set install=True to install the update.
Returns a dict containing a list of updates that match the name if download and install are both set to False. Should usually be a single update, but can return multiple if a partial name is given.
If download or install is set to true it will return the results of the operation.
# Recommended Usage using GUID without braces # Use this to find the status of a specific update salt '*' win_wua.get 12345678-abcd-1234-abcd-1234567890ab
# Use the following if you don't know the GUID:
# Using a KB number # Not all updates have an associated KB salt '*' win_wua.get KB3030298
# Using part or all of the name of the update # Could possibly return multiple results # Not all updates have an associated KB salt '*' win_wua.get 'Microsoft Camera Codec Pack'
salt.modules.win_wua.get_needs_reboot() Determines if the system needs to be rebooted.
Returns True if the system requires a reboot, otherwise False
salt '*' win_wua.get_needs_reboot
salt.modules.win_wua.get_wu_settings() Get current Windows Update settings.
Returns A dictionary of Windows Update settings:
Featured Updates: Boolean value that indicates whether to display notifications for featured updates.
Group Policy Required (Read-only): Boolean value that indicates whether Group Policy requires the Automatic Updates service.
Microsoft Update: Boolean value that indicates whether to turn on Microsoft Update for other Microsoft Products
Needs Reboot: Boolean value that indicates whether the machine is in a reboot pending state.
Non Admins Elevated: Boolean value that indicates whether non-administrators can perform some update-related actions without administrator approval.
Notification Level: Number 1 to 4 indicating the update level:
1. Never check for updates
2. Check for updates but let me choose whether to download and install them
3. Download updates but let me choose whether to install them
4. Install updates automatically
Read Only (Read-only): Boolean value that indicates whether the Automatic Update settings are read-only.
Recommended Updates: Boolean value that indicates whether to include optional or recommended updates when a search for updates and installation of updates is performed.
Scheduled Day: Days of the week on which Automatic Updates installs or uninstalls updates.
Scheduled Time: Time at which Automatic Updates installs or uninstalls updates.
salt '*' win_wua.get_wu_settings
salt.modules.win_wua.install(names) New in version 2017.7.0.
Installs updates that match the list of identifiers. It may be easier to use the list_updates function and set install=True.
Parameters names (str, list) -- A single update or a list of updates to install. This can be any combination of GUIDs, KB numbers, or names. GUIDs or KBs are preferred.
Returns A dictionary containing the details about the installed updates
# Normal Usage salt '*' win_wua.install KB12323211
salt.modules.win_wua.installed(summary=False, kbs_only=False) New in version 3001.
Get a list of all updates that are currently installed on the system.
NOTE: This list may not necessarily match the Update History on the machine.  This will only show the updates that apply to the current build of Windows. So, for example, the system may have shipped with Windows 10 Build 1607. That machine received updates to the 1607 build. Later the machine was upgraded to a newer feature release, 1803 for example. Then more updates were applied. This will only return the updates applied to the 1803 build and not those applied when the system was at the 1607 build.
• summary (bool) -- Return a summary instead of a detailed list of updates. True will return a Summary, False will return a detailed list of installed updates. Default is False
• kbs_only (bool) -- Only return a list of KBs installed on the system. If this parameter is passed, the summary parameter will be ignored. Default is False
Returns a dictionary of either a Summary or a detailed list of updates installed on the system when kbs_only=False
list:  Returns a list of KBs installed on the system when kbs_only=True
# Get a detailed list of all applicable updates installed on the system salt '*' win_wua.installed
# Get a summary of all applicable updates installed on the system salt '*' win_wua.installed summary=True
# Get a simple list of KBs installed on the system salt '*' win_wua.installed kbs_only=True
salt.modules.win_wua.list(software=True, drivers=False, summary=False, skip_installed=True, categories=None, severities=None, download=False, install=False, online=True) New in version 2017.7.0.
Returns a detailed list of available updates or a summary. If download or install is True the same list will be downloaded and/or installed.
• drivers (bool) -- Include driver updates in the results. Default is False
• skip_installed (bool) -- Skip installed updates in the results. Default is True
• download (bool) -- (Overrides reporting functionality) Download the list of updates returned by this function. Run this function first with download=False to see what will be downloaded, then set download=True to download the updates. Default is False
• install (bool) -- (Overrides reporting functionality) Install the list of updates returned by this function. Run this function first with install=False to see what will be installed, then set install=True to install the updates. Default is False
# Normal Usage (list all software updates) salt '*' win_wua.list
# List all updates with categories of Critical Updates and Drivers salt '*' win_wua.list categories=['Critical Updates','Drivers']
# List all Critical Security Updates salt '*' win_wua.list categories=['Security Updates'] severities=['Critical']
# List all updates with a severity of Critical salt '*' win_wua.list severities=['Critical']
# A summary of all available updates salt '*' win_wua.list summary=True
# A summary of all Feature Packs and Windows 8.1 Updates salt '*' win_wua.list categories=['Feature Packs','Windows 8.1'] summary=True
salt.modules.win_wua.set_wu_settings(level=None, recommended=None, featured=None, elevated=None, msupdate=None, day=None, time=None) Change Windows Update settings. If no parameters are passed, the current value will be returned.
Supported:
• level (int) --
Number from 1 to 4 indicating the update level:
• recommended (bool) -- Boolean value that indicates whether to include optional or recommended updates when a search for updates and installation of updates is performed.
• featured (bool) -- Boolean value that indicates whether to display notifications for featured updates.
• elevated (bool) -- Boolean value that indicates whether non-administrators can perform some update-related actions without administrator approval.
• msupdate (bool) -- Boolean value that indicates whether to turn on Microsoft Update for other Microsoft products
• day (str) --
Days of the week on which Automatic Updates installs or uninstalls updates. Accepted values:
• Everyday
• Monday
• Tuesday
• Wednesday
• Thursday
• Friday
• Saturday
• time (str) -- Time at which Automatic Updates installs or uninstalls updates. Must be in the ##:## 24hr format, eg. 3:00 PM would be 15:00. Must be in 1 hour increments.
Returns Returns a dictionary containing the results.
salt '*' win_wua.set_wu_settings level=4 recommended=True featured=False
salt.modules.win_wua.uninstall(names) New in version 2017.7.0.
Uninstall updates.
Parameters names (str, list) -- A single update or a list of updates to uninstall. This can be any combination of GUIDs, KB numbers, or names. GUIDs or KBs are preferred.
Returns A dictionary containing the details about the uninstalled updates
# Normal Usage salt '*' win_wua.uninstall KB3121212
# As a list salt '*' win_wua.uninstall guid=['12345678-abcd-1234-abcd-1234567890ab', 'KB1231231']
salt.modules.win_wusa Microsoft Update files management via wusa.exe
maintainer Thomas Lemarchand
salt.modules.win_wusa.install(path, restart=False) Install a KB from a .msu file.
• path (str) -- The full path to the msu file to install
• restart (bool) -- True to force a restart if required by the installation. Adds the /forcerestart switch to the wusa.exe command. False will add the /norestart switch instead. Default is False
Raises CommandExecutionError -- If the package is already installed or an error is encountered
salt '*' wusa.install C:/temp/KB123456.msu
salt.modules.win_wusa.is_installed(name) Check if a specific KB is installed.
Parameters name (str) -- The name of the KB to check
salt '*' wusa.is_installed KB123456
salt.modules.win_wusa.list() Get a list of updates installed on the machine
Returns A list of installed updates
salt '*' wusa.list
salt.modules.win_wusa.uninstall(path, restart=False) Uninstall a specific KB.
• path (str) -- The full path to the msu file to uninstall. This can also be just the name of the KB to uninstall
Raises CommandExecutionError -- If an error is encountered
salt '*' wusa.uninstall KB123456
salt '*' wusa.uninstall C:/temp/KB123456.msu
salt.modules.winrepo Module to manage Windows software repo on a Standalone Minion
file_client: local must be set in the minion config file.
For documentation on Salt's Windows Repo feature, see here.
salt.modules.winrepo.genrepo() Generate winrepo_cachefile based on sls files in the winrepo_dir
salt-call winrepo.genrepo
salt.modules.winrepo.show_sls(name, saltenv='base') New in version 2015.8.0.
Display the rendered software definition from a specific sls file in the local winrepo cache. This will parse all Jinja. Run pkg.refresh_db to pull the latest software definitions from the master.
NOTE: This function does not ask a master for an sls file to render. Instead it directly processes the file specified in name
• str (saltenv) -- The name/path of the package you want to view. This can be the
• path to a file on the minion file system or a file on the local (full) --
• cache. (minion) --
• str -- The default environment is base
Returns Returns a dictionary containing the rendered data structure
NOTE: To use a file from the minion cache start from the local winrepo root (C:\salt\var\cache\salt\minion\files\base\win\repo-ng). If you have .sls files organized in subdirectories you'll have to denote them with .. For example, if you have a test directory in the winrepo root with a gvim.sls file inside, would target that file like so: test.gvim. Directories can be targeted as well as long as they contain an init.sls inside. For example, if you have a node directory with an init.sls inside, target that like so: node.
salt '*' winrepo.show_sls gvim salt '*' winrepo.show_sls test.npp salt '*' winrepo.show_sls C:\test\gvim.sls
salt.modules.winrepo.update_git_repos(clean=False) Checkout git repos containing Windows Software Package Definitions.
IMPORTANT: This function requires Git for Windows to be installed in order to work. When installing, make sure to select an installation option which permits the git executable to be run from the Command Prompt.
clean  False Clean repo cachedirs which are not configured under winrepo_remotes.
NOTE: This option only applies if either pygit2 or GitPython is installed into Salt's bundled Python.
WARNING: This argument should not be set to True if a mix of git and non-git repo definitions are being used, as it will result in the non-git repo definitions being removed.
salt-call winrepo.update_git_repos
salt.modules.wordpress This module is used to manage Wordpress installations
depends wp binary from http://wp-cli.org/
class salt.modules.wordpress.Plugin(name, status, update, versino)
name   Alias for field number 0
status Alias for field number 1
update Alias for field number 2
versino Alias for field number 3
salt.modules.wordpress.activate(name, path, user) Activate a wordpress plugin
name   Wordpress plugin name
path   path to wordpress install location
user   user to run the command as
salt '*' wordpress.activate HyperDB /var/www/html apache
salt.modules.wordpress.deactivate(name, path, user) Deactivate a wordpress plugin
salt '*' wordpress.deactivate HyperDB /var/www/html apache
salt.modules.wordpress.install(path, user, admin_user, admin_password, admin_email, title, url) Run the initial setup functions for a wordpress install
admin_user Username for the Administrative user for the wordpress install
admin_password Initial Password for the Administrative user for the wordpress install
admin_email Email for the Administrative user for the wordpress install
title  Title of the wordpress website for the wordpress install
url    Url for the wordpress install
salt '*' wordpress.install /var/www/html apache dwallace password123             dwallace@example.com "Daniel's Awesome Blog" https://blog.dwallace.com
salt.modules.wordpress.is_installed(path, user=None) Check if wordpress is installed and setup
salt '*' wordpress.is_installed /var/www/html apache
salt.modules.wordpress.list_plugins(path, user) List plugins in an installed wordpress path
salt '*' wordpress.list_plugins /var/www/html apache
salt.modules.wordpress.show_plugin(name, path, user) Show a plugin in a wordpress install and check if it is installed
salt '*' wordpress.show_plugin HyperDB /var/www/html apache
salt.modules.x509 Manage X509 certificates
depends M2Crypto
salt.modules.x509.create_certificate(path=None, text=False, overwrite=True, ca_server=None, **kwargs) Create an X509 certificate.
path:  Path to write the certificate to.
text:  If True, return the PEM text without writing to a file. Default False.
overwrite: If True (default), create_certificate will overwrite the entire PEM file. Set False to preserve existing private keys and dh params that may exist in the PEM file.
kwargs: Any of the properties below can be included as additional keyword arguments.
ca_server: Request a remotely signed certificate from ca_server. For this to work, a signing_policy must be specified, and that same policy must be configured on the ca_server. See signing_policy for details. Also, the salt master must permit peers to call the sign_remote_certificate function.
/etc/salt/master.d/peer.conf
peer: .*: - x509.sign_remote_certificate
subject properties: Any of the values below can be included to set subject properties Any other subject properties supported by OpenSSL should also work.
C:     2 letter Country code
CN:    Certificate common name, typically the FQDN.
Email: Email address
GN:    Given Name
L:     Locality
O:     Organization
OU:    Organization Unit
SN:    SurName
ST:    State or Province
signing_private_key: A path or string of the private key in PEM format that will be used to sign this certificate. If neither signing_cert, public_key, or csr are included, it will be assumed that this is a self-signed certificate, and the public key matching signing_private_key will be used to create the certificate.
signing_private_key_passphrase: Passphrase used to decrypt the signing_private_key.
signing_cert: A certificate matching the private key that will be used to sign this certificate. This is used to populate the issuer values in the resulting certificate. Do not include this value for self-signed certificates.
public_key: The public key to be included in this certificate. This can be sourced from a public key, certificate, CSR or private key. If a private key is used, the matching public key from the private key will be generated before any processing is done. This means you can request a certificate from a remote CA using a private key file as your public_key and only the public key will be sent across the network to the CA. If neither public_key or csr are specified, it will be assumed that this is a self-signed certificate, and the public key derived from signing_private_key will be used. Specify either public_key or csr, not both. Because you can input a CSR as a public key or as a CSR, it is important to understand the difference.  If you import a CSR as a public key, only the public key will be added to the certificate, subject or extension information in the CSR will be lost.
public_key_passphrase: If the public key is supplied as a private key, this is the passphrase used to decrypt it.