Skip to content

Latest commit

 

History

History
159 lines (132 loc) · 3.9 KB

File metadata and controls

159 lines (132 loc) · 3.9 KB

DSC Resource 'WebConfigPropertyCollections'

WebConfigPropertyCollections manages collection-based properties in IIS web.config configuration files.

When to use 'WebConfigPropertyCollections'

Use this resource when you need to manage items within IIS configuration collections (arrays of elements in web.config). This is used for settings that are defined as collections, such as adding custom HTTP headers, MIME types, handler mappings, or module entries.

Source

DSC Resource

Documentation

Table 1. Attributes of category 'WebConfigPropertyCollections'
Parameter Attribute DataType Description Allowed Values

Items

Mandatory

Hashtable[]

set of web config properties

Table 2. Attributes of category 'WebConfigPropertyCollections/Items'
Parameter Attribute DataType Description Allowed Values

WebsitePath

Key

String

Path to website location (IIS or WebAdministration format).

Filter

Key

String

Filter used to locate property to update.

CollectionName

Key

String

Name of the property collection to update.

ItemName

Key

String

Name of the property collection item to update.

ItemKeyName

Key

String

Name of the key of the property collection item to update.

ItemKeyValue

Key

String

Value of the key of the property collection item to update.

ItemPropertyName

Key

String

Name of the property of the property collection item to update.

ItemPropertyValue

String

Value of the property of the property collection item to update.

Ensure

String

Indicates if the property and value of the property collection item should be present or absent.

  • Present (default)

  • Absent

Example
WebConfigPropertyCollections:
  Items:
    - WebsitePath: MACHINE/WEBROOT/APPHOST
      Filter: system.webServer/isapiFilters
      CollectionName: .
      ItemName: filter
      ItemKeyName: name
      ItemKeyValue: ASP.Net_2.0.50727-64
      ItemPropertyName: enabled
      ItemPropertyValue: true
    - WebsitePath: MACHINE/WEBROOT/APPHOST
      Filter: system.webServer/isapiFilters
      CollectionName: .
      ItemName: filter
      ItemKeyName: name
      ItemKeyValue: ASP.Net_4.0_64bit
      ItemPropertyName: enabled
      ItemPropertyValue: true
    - WebsitePath: MACHINE/WEBROOT/APPHOST
      Filter: system.webServer/security/isapiCgiRestriction
      CollectionName: .
      ItemName: add
      ItemKeyName: path
      ItemKeyValue: C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
      ItemPropertyName: allowed
      ItemPropertyValue: True
    - WebsitePath: MACHINE/WEBROOT/APPHOST
      Filter: system.webServer/security/isapiCgiRestriction
      CollectionName: .
      ItemName: add
      ItemKeyName: path
      ItemKeyValue: C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
      ItemPropertyName: groupId
      ItemPropertyValue: ASP.NET v2.0.50727