salt.modules.win_servermanager

Manage Windows features via the ServerManager powershell module

salt.modules.win_servermanager.install(feature, recurse=False)

Install a feature

注解

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

注解

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

参数:
  • feature (str) -- The name of the feature to install
  • recurse (bool) -- Install all sub-features
返回:

A dictionary containing the results of the install

返回类型:

dict

CLI 范例:

salt '*' win_servermanager.install Telnet-Client
salt '*' win_servermanager.install SNMP-Service True
salt.modules.win_servermanager.list_available()

List available features to install

返回:A list of available features
返回类型:list

CLI 范例:

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

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

返回:A list of installed features
返回类型:list

CLI 范例:

salt '*' win_servermanager.list_installed
salt.modules.win_servermanager.remove(feature)

Remove an installed feature

注解

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.

参数:feature (str) -- The name of the feature to remove
返回:A dictionary containing the results of the uninstall
返回类型:dict

CLI 范例:

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