salt.modules.win_servermanager

Manage Windows features via the ServerManager powershell module

salt.modules.win_servermanager.install(feature, recurse=False, restart=False, source=None, exclude=None)

Install a feature

Note

Some features require reboot after un/installation, if so until the server is restarted other features can not be installed!

Note

Some features take a long time to complete un/installation, set -t with a long timeout

Parameters:
  • feature (str) -- The name of the feature to install
  • recurse (bool) -- Install all sub-features. Default is False
  • source (str) -- Path to the source files if missing from the target system. None means that the system will use windows update services to find the required files. Default is None
  • restart (bool) -- Restarts the computer when installation is complete, if required by the role/feature installed. Default is False
  • exclude (str) --

    The name of the feature to exclude when installing the named feature.

    Note

    As there is no exclude option for the Add-WindowsFeature command, the feature will be installed with other sub-features and will then be removed.

  • restart -- Restarts the computer when installation is complete, if required by the role feature installed.
Returns:

A dictionary containing the results of the install

Return type:

dict

CLI Example:

salt '*' win_servermanager.install Telnet-Client
salt '*' win_servermanager.install SNMP-Service True
salt '*' win_servermanager.install TFTP-Client source=d:\side-by-side
salt.modules.win_servermanager.list_available()

List available features to install

Returns:A list of available features
Return type:list

CLI Example:

salt '*' win_servermanager.list_available
salt.modules.win_servermanager.list_installed()

List installed features. Supported on Windows Server 2008 and Windows 8 and newer.

Returns:A list of installed features
Return type:list

CLI Example:

salt '*' win_servermanager.list_installed
salt.modules.win_servermanager.remove(feature, remove_payload=False, restart=False)

Remove an installed feature

Note

Some features require a reboot after installation/uninstallation. If one of these features are modified, then other features cannot be installed until the server is restarted. Additionally, some features take a while to complete installation/uninstallation, so it is a good idea to use the -t option to set a longer timeout.

Parameters:
  • feature (str) -- The name of the feature to remove
  • remove_payload (bool) -- True will cause the feature to be removed from the side-by-side store (%SystemDrive%:\Windows\WinSxS). Default is False
  • restart (bool) -- Restarts the computer when uninstall is complete, if required by the role/feature removed. Default is False
Returns:

A dictionary containing the results of the uninstall

Return type:

dict

CLI Example:

salt -t 600 '*' win_servermanager.remove Telnet-Client