Add-WebConfigurationLock

Locks an IIS configuration section or element.

Syntax

Add-WebConfigurationLock
   -Type <String>
   [-Force]
   [-Passthru]
   [-Location <String[]>]
   [-Filter] <String[]>
   [[-PSPath] <String[]>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Locks an IIS configuration section, element, or attribute.

Examples

-------------- EXAMPLE 1: Adding and removing configuration locks --------------

IIS:\>Add-WebConfigurationLock -Type general -Filter //asp Remove-WebConfigurationLock -Filter //asp Add-WebConfigurationLock -Type inclusive -Filter //asp/@lcid Remove-WebConfigurationLock -Filter //asp/@lcid Add-WebConfigurationLock -Type exclusive -Filter //asp/@lcid

This example demonstrates how to add and remove inclusive and exclusive locks using a filter.

Required Parameters

-Filter

An XPath filter expression.

Type:String[]
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Type

Specifies the type of configuration lock to add.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Force

Forces the configuration lock.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Location

The location at which the configuration lock is applied.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PSPath

Specifies the configuration path. This can be either an IIS configuration path in the formatcomputer name/webroot/apphost, or the IIS module path in this format IIS:\sites\Default Web Site.

Type:String[]
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Passthru

Passes an object that represents the configuration lock to the pipeline.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False