salt.modules.win_iis
Microsoft IIS site management via WebAdministration powershell module
- maintainer
-
Shane Lee <slee@saltstack.com>, Robert Booth <rbooth@saltstack.com>
- platform
-
Windows
- depends
-
PowerShell
- depends
-
WebAdministration module (PowerShell) (IIS)
New in version 2016.3.0.
-
Create an IIS application.
Note
This function only validates against the application name, and will return True even if the application already exists with a different configuration. It will not modify the configuration of an existing application.
- Parameters
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.create_app name='app0' site='site0' sourcepath='C:\site0' apppool='site0'
salt.modules.win_iis.create_app(name, site, sourcepath, apppool=None)
-
Create an IIS application pool.
Note
This function only validates against the application pool name, and will return True even if the application pool already exists with a different configuration. It will not modify the configuration of an existing application pool.
- Parameters
-
name (str) -- The name of the IIS application pool.
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.create_apppool name='MyTestPool'
salt.modules.win_iis.create_apppool(name)
-
Backup an IIS Configuration on the System.
New in version 2017.7.0.
Note
Backups are stored in the
$env:Windir\System32\inetsrv\backup
folder.- Parameters
-
name (str) -- The name to give the backup
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.create_backup good_config_20170209
salt.modules.win_iis.create_backup(name)
-
Create an IIS Web Binding.
Note
This function only validates against the binding ipaddress:port:hostheader combination, and will return True even if the binding already exists with a different configuration. It will not modify the configuration of an existing binding.
- Parameters
-
site (str) -- The IIS site name.
hostheader (str) -- The host header of the binding. Usually a hostname.
ipaddress (str) -- The IP address of the binding.
port (int) -- The TCP port of the binding.
protocol (str) -- The application protocol of the binding.
sslflags (str) -- The flags representing certificate type and storage of the binding.
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.create_binding site='site0' hostheader='example.com' ipaddress='*' port='80'
salt.modules.win_iis.create_binding(site, hostheader='', ipaddress='*', port=80, protocol='http', sslflags=None)
-
Assign a certificate to an IIS Web Binding.
New in version 2016.11.0.
Note
The web binding that the certificate is being assigned to must already exist.
- Parameters
-
name (str) -- The thumbprint of the certificate.
site (str) -- The IIS site name.
hostheader (str) -- The host header of the binding.
ipaddress (str) -- The IP address of the binding.
port (int) -- The TCP port of the binding.
sslflags (int) -- Flags representing certificate type and certificate storage of the binding.
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.create_cert_binding name='AAA000' site='site0' hostheader='example.com' ipaddress='*' port='443'
salt.modules.win_iis.create_cert_binding(name, site, hostheader='', ipaddress='*', port=443, sslflags=0)
-
Create a basic website in IIS.
Note
This function only validates against the site name, and will return True even if the site already exists with a different configuration. It will not modify the configuration of an existing site.
- Parameters
-
name (str) -- The IIS site name.
sourcepath (str) -- The physical path of the IIS site.
apppool (str) -- The name of the IIS application pool.
hostheader (str) -- The host header of the binding. Usually the hostname or website name, ie: www.contoso.com
ipaddress (str) -- The IP address of the binding.
port (int) -- The TCP port of the binding.
protocol (str) -- The application protocol of the binding. (http, https, etc.)
- Returns
-
True if successful, otherwise False.
- Return type
Note
If an application pool is specified, and that application pool does not already exist, it will be created.
CLI Example:
salt '*' win_iis.create_site name='My Test Site' sourcepath='c:\stage' apppool='TestPool'
salt.modules.win_iis.create_site(name, sourcepath, apppool='', hostheader='', ipaddress='*', port=80, protocol='http')
-
Create an IIS virtual directory.
Note
This function only validates against the virtual directory name, and will return True even if the virtual directory already exists with a different configuration. It will not modify the configuration of an existing virtual directory.
- Parameters
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.create_vdir name='vd0' site='site0' sourcepath='C:\inetpub\vdirs\vd0'
salt.modules.win_iis.create_vdir(name, site, sourcepath, app='/')
-
Get the value of the setting for the IIS container.
New in version 2016.11.0.
- Parameters
- Returns
-
A dictionary of the provided settings and their values.
- Return type
CLI Example:
salt '*' win_iis.get_container_setting name='MyTestPool' container='AppPools' settings="['processModel.identityType']"
salt.modules.win_iis.get_container_setting(name, container, settings)
-
New in version 2017.7.0.
Get the value of the setting for the IIS web application.
Note
Params are case sensitive
- Parameters
- Returns
-
A dictionary of the provided settings and their values.
- Return type
CLI Example:
salt '*' win_iis.get_webapp_settings name='app0' site='Default Web Site' settings="['physicalPath','applicationPool']"
salt.modules.win_iis.get_webapp_settings(name, site, settings)
-
Get the webconfiguration settings for the IIS PSPath.
- Parameters
- Returns
-
A list of dictionaries containing setting name, filter and value.
- Return type
CLI Example:
salt '*' win_iis.get_webconfiguration_settings name='IIS:\' settings="[{'name': 'enabled', 'filter': 'system.webServer/security/authentication/anonymousAuthentication'}]"
salt.modules.win_iis.get_webconfiguration_settings(name, settings)
-
List all configured IIS application pools.
- Returns
-
A dictionary of IIS application pools and their details.
- Return type
CLI Example:
salt '*' win_iis.list_apppools
salt.modules.win_iis.list_apppools()
-
Get all configured IIS applications for the specified site.
- Parameters
-
site (str) -- The IIS site name.
Returns: A dictionary of the application names and properties.
CLI Example:
salt '*' win_iis.list_apps site
salt.modules.win_iis.list_apps(site)
-
List the IIS Configuration Backups on the System.
New in version 2017.7.0.
Note
Backups are made when a configuration is edited. Manual backups are stored in the
$env:Windir\System32\inetsrv\backup
folder.- Returns
-
A dictionary of IIS Configurations backed up on the system.
- Return type
CLI Example:
salt '*' win_iis.list_backups
salt.modules.win_iis.list_backups()
-
Get all configured IIS bindings for the specified site.
- Parameters
-
site (str) -- The name if the IIS Site
- Returns
-
A dictionary of the binding names and properties.
- Return type
CLI Example:
salt '*' win_iis.list_bindings site
salt.modules.win_iis.list_bindings(site)
-
List certificate bindings for an IIS site.
New in version 2016.11.0.
- Parameters
-
site (str) -- The IIS site name.
- Returns
-
A dictionary of the binding names and properties.
- Return type
CLI Example:
salt '*' win_iis.list_bindings site
salt.modules.win_iis.list_cert_bindings(site)
-
List all the currently deployed websites.
- Returns
-
A dictionary of the IIS sites and their properties.
- Return type
CLI Example:
salt '*' win_iis.list_sites
salt.modules.win_iis.list_sites()
-
Get all configured IIS virtual directories for the specified site, or for the combination of site and application.
- Parameters
- Returns
-
A dictionary of the virtual directory names and properties.
- Return type
CLI Example:
salt '*' win_iis.list_vdirs site
salt.modules.win_iis.list_vdirs(site, app='/')
-
Returns a list of worker processes that correspond to the passed application pool.
New in version 2017.7.0.
- Parameters
-
apppool (str) -- The application pool to query
- Returns
-
A dictionary of worker processes with their process IDs
- Return type
CLI Example:
salt '*' win_iis.list_worker_processes 'My App Pool'
salt.modules.win_iis.list_worker_processes(apppool)
-
Modify an IIS Web Binding. Use
site
andbinding
to target the binding.New in version 2017.7.0.
- Parameters
-
site (str) -- The IIS site name.
binding (str) -- The binding to edit. This is a combination of the IP address, port, and hostheader. It is in the following format: ipaddress:port:hostheader. For example,
*:80:
or*:80:salt.com
hostheader (str) -- The host header of the binding. Usually the hostname.
ipaddress (str) -- The IP address of the binding.
port (int) -- The TCP port of the binding.
sslflags (str) -- The flags representing certificate type and storage of the binding.
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
The following will seat the host header of binding
*:80:
forsite0
toexample.com
salt '*' win_iis.modify_binding site='site0' binding='*:80:' hostheader='example.com'
salt.modules.win_iis.modify_binding(site, binding, hostheader=None, ipaddress=None, port=None, sslflags=None)
-
Modify a basic website in IIS.
New in version 2017.7.0.
- Parameters
- Returns
-
True if successful, otherwise False.
- Return type
Note
If an application pool is specified, and that application pool does not already exist, it will be created.
CLI Example:
salt '*' win_iis.modify_site name='My Test Site' sourcepath='c:\new_path' apppool='NewTestPool'
salt.modules.win_iis.modify_site(name, sourcepath=None, apppool=None)
-
Remove an IIS application.
- Parameters
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.remove_app name='app0' site='site0'
salt.modules.win_iis.remove_app(name, site)
-
Remove an IIS application pool.
- Parameters
-
name (str) -- The name of the IIS application pool.
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.remove_apppool name='MyTestPool'
salt.modules.win_iis.remove_apppool(name)
-
Remove an IIS Configuration backup from the System.
New in version 2017.7.0.
- Parameters
-
name (str) -- The name of the backup to remove
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.remove_backup backup_20170209
salt.modules.win_iis.remove_backup(name)
-
Remove an IIS binding.
- Parameters
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.remove_binding site='site0' hostheader='example.com' ipaddress='*' port='80'
salt.modules.win_iis.remove_binding(site, hostheader='', ipaddress='*', port=80)
-
Remove a certificate from an IIS Web Binding.
New in version 2016.11.0.
Note
This function only removes the certificate from the web binding. It does not remove the web binding itself.
- Parameters
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.remove_cert_binding name='AAA000' site='site0' hostheader='example.com' ipaddress='*' port='443'
salt.modules.win_iis.remove_cert_binding(name, site, hostheader='', ipaddress='*', port=443)
-
Delete a website from IIS.
- Parameters
-
name (str) -- The IIS site name.
- Returns
-
True if successful, otherwise False
- Return type
Note
This will not remove the application pool used by the site.
CLI Example:
salt '*' win_iis.remove_site name='My Test Site'
salt.modules.win_iis.remove_site(name)
-
Remove an IIS virtual directory.
- Parameters
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.remove_vdir name='vdir0' site='site0'
salt.modules.win_iis.remove_vdir(name, site, app='/')
-
Restart an IIS application pool.
New in version 2016.11.0.
- Parameters
-
name (str) -- The name of the IIS application pool.
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.restart_apppool name='MyTestPool'
salt.modules.win_iis.restart_apppool(name)
-
Restart a Web Site in IIS.
New in version 2017.7.0.
- Parameters
-
name (str) -- The name of the website to restart.
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.restart_site name='My Test Site'
salt.modules.win_iis.restart_site(name)
-
Set the value of the setting for an IIS container.
New in version 2016.11.0.
- Parameters
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.set_container_setting name='MyTestPool' container='AppPools' settings="{'managedPipeLineMode': 'Integrated'}"
salt.modules.win_iis.set_container_setting(name, container, settings)
-
New in version 2017.7.0.
Configure an IIS application.
Note
This function only configures an existing app. Params are case sensitive.
- Parameters
-
name (str) -- The IIS application.
site (str) -- The IIS site name.
settings (str) -- A dictionary of the setting names and their values. - physicalPath: The physical path of the webapp. - applicationPool: The application pool for the webapp. - userName: "connectAs" user - password: "connectAs" password for user
- Returns
-
A boolean representing whether all changes succeeded.
- Return type
CLI Example:
salt '*' win_iis.set_webapp_settings name='app0' site='site0' settings="{'physicalPath': 'C:\site0', 'apppool': 'site0'}"
salt.modules.win_iis.set_webapp_settings(name, site, settings)
-
Set the value of the setting for an IIS container.
- Parameters
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.set_webconfiguration_settings name='IIS:\' settings="[{'name': 'enabled', 'filter': 'system.webServer/security/authentication/anonymousAuthentication', 'value': False}]"
salt.modules.win_iis.set_webconfiguration_settings(name, settings)
-
Start an IIS application pool.
New in version 2017.7.0.
- Parameters
-
name (str) -- The name of the App Pool to start.
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.start_apppool name='MyTestPool'
salt.modules.win_iis.start_apppool(name)
-
Start a Web Site in IIS.
New in version 2017.7.0.
- Parameters
-
name (str) -- The name of the website to start.
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.start_site name='My Test Site'
salt.modules.win_iis.start_site(name)
-
Stop an IIS application pool.
New in version 2017.7.0.
- Parameters
-
name (str) -- The name of the App Pool to stop.
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.stop_apppool name='MyTestPool'
salt.modules.win_iis.stop_apppool(name)
-
Stop a Web Site in IIS.
New in version 2017.7.0.
- Parameters
-
name (str) -- The name of the website to stop.
- Returns
-
True if successful, otherwise False
- Return type
CLI Example:
salt '*' win_iis.stop_site name='My Test Site'
salt.modules.win_iis.stop_site(name)
© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.win_iis.html