Manage Windows features via the ServerManager powershell module. Can list available and installed roles/features. Can install and remove roles/features.
maintainer: | Shane Lee <slee@saltstack.com> |
---|---|
platform: | Windows Server 2008R2 or greater |
depends: | PowerShell module ServerManager
|
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: |
|
---|---|
Returns: |
A dictionary containing the results of the install |
Return type: |
CLI Example:
# Install the Telnet Client passing a single string salt '*' win_servermanager.install Telnet-Client # Install the TFTP Client and the SNMP Service passing a comma-delimited # string. Install all sub-features salt '*' win_servermanager.install TFTP-Client,SNMP-Service recurse=True # Install the TFTP Client from d:\side-by-side salt '*' win_servermanager.install TFTP-Client source=d:\\side-by-side # Install the XPS Viewer, SNMP Service, and Remote Access passing a # list. Install all sub-features, but exclude the Web Server salt '*' win_servermanager.install "['XPS-Viewer', 'SNMP-Service', 'RemoteAccess']" True recurse=True exclude="Web-Server"
List available features to install
Returns: | A list of available features as returned by the Get-WindowsFeature PowerShell command |
---|---|
Return type: | str |
CLI Example:
salt '*' win_servermanager.list_available
List installed features. Supported on Windows Server 2008 and Windows 8 and newer.
Returns: | A dictionary of installed features |
---|---|
Return type: | dict |
CLI Example:
salt '*' win_servermanager.list_installed
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: |
|
---|---|
Returns: |
A dictionary containing the results of the uninstall |
Return type: |
CLI Example:
salt -t 600 '*' win_servermanager.remove Telnet-Client
© 2019 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.win_servermanager.html