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

The Add-WebConfigurationLock cmdlet locks an Internet Information Services (IIS) configuration section, element, or attribute.

Examples

Example 1: Add and remove configuration locks

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

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

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-Filter

Specifies an XPath filter expression.

Type:String[]
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Force

Forces the configuration lock.

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

-Location

Specifies the location at which this cmdlet applies the configuration lock.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Passthru

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

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

-PSPath

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

Type:String[]
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Type

Specifies the type of configuration lock that this cmdlet adds.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False