Web Deploy Operation Settings

Applies To: Windows 7, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP

Web Deploy operation settings are non-provider specific command-line flags. They modify all of a Web Deploy operation. On the command-line prompt, each operation setting is preceded by a hyphen. The following lists the Web Deploy operation settings, their descriptions, and example usages.

Setting

allowUntrusted

Usage

-allowUntrusted

Description

When specified, untrusted SSL connections are allowed; otherwise, untrusted SSL Connections are not allowed.

Example

msdeploy -verb:sync -source:apphostconfig="Default Web Site" -dest:apphostconfig="Default Web Site",computername=Server2 -allowUntrusted

Setting

appHostConfigDir

Usage

-appHostConfigDir=<DirectoryPath>

Description

Specifies the path of the ApplicationHost.config file for the current instance of IIS Express. The default path is %SystemDrive%\Users\<UserId>\Documents\IISExpress8\config.

Example

Synchronize a WordPress site that is running on IIS Express to IIS on the computer IISWebServer1. Use the ApplicationHost.config file in the IIS Express configuration path for User1.

msdeploy -verb:sync -source:webApp="wordpress" -dest:auto,computername=IISWebServer1 -appHostConfigDir=c:\users\user1\documents\iisexpress\config

Setting

declareParam

Usage

-declareParam:name=<ParameterName>

,kind=<ParameterKind>

,scope=<ParameterScope>

,match=<RegularExpression>

,defaultValue=<string>

,description=<ParameterDescription>

Description

Creates a user-specified parameter for a package or archive. When the package or archive is later synchronized, the value of the declared parameter is specified by using -setParam. For more information, see Using declareParam and setParam.

Example

This example creates a package file based on the default Web site and declares a "param" parameter that will match the value attribute of <add> elements.

msdeploy -verb:sync -source:apphostconfig="Default Web Site" -dest:package=ParameterPackage.zip -declareParam:name=param,kind=XmlFile,scope=web.config,match=//add/@value

Setting

declareParamFile

Usage

-declareParamFile:<XMLFile>

Description

Specifies an XML file that contains declarations of parameters that will be used in an operation. The XML format of the declared parameters matches that of the parameters that are found in the archive or package.

Example

This example creates a package file from IIS 6.0 Site 1 and declares a parameters file called Myparams.xml.

msdeploy -verb:sync -source:metakey="lm\w3svc\1" -dest:package="c:\packages\myzip5.zip" -declareParamFile="c:\myparams.xml"

Setting

dest

Usage

-dest:<providerName>[=<pathToObject>[,<providerSetting>=<providerSettingValue>],…]

Description

Specifies the destination (the target object) of the operation that the -verb argument specifies. The <provider> and its associated settings more narrowly define the destination object or how it will be processed. For more information about providers, see Web Deploy Providers. For more information about provider settings, see Web Deploy Provider Settings.

Example

This example synchronizes the contents of the source Web site Fabrikam1 to the destination Web site Fabrikam2.

msdeploy.exe -verb:sync -source:contentPath="Fabrikam1" -dest:contentPath="Fabrikam2"

Setting

disableLink

Usage

-disableLink:<LinkExtensionName>, <LinkExtensionName>

Description

Disables one or more specified link extensions during a synchronization operation. The link extensions are specified after -disableLink in a comma-delimited list. You can specify the link extension names directly, or use regular expressions that resolve to valid Web Deploy link extension names.

The Web Deploy link extensions are AppPoolExtension, CertificateExtension, ContentExtension, FrameworkConfigExtension, and HttpCertConfigExtension. For more information about link extensions, see Web Deploy Link Extensions. For more information about regular expressions, see Regular Expressions. This setting does not apply to the dump operation.

Example

This example disables the ContentExtension so that no content is included in the operation.

msdeploy -verb:sync -disableLink:ContentExtension -source:archiveDir:c:\myArchive -dest:metakey=lm/w3svc/1

Setting

disableRule

Usage

-disableRule:<RuleName>, <RuleName>

Description

Disables the specified synchronization rule or rules during a synchronization operation. The rules are specified after -disableRule in a comma-delimited list. You can specify the rule names directly, or use a regular expression that resolves to valid Web Deploy rules. The specified rule name can also be followed by an asterisk wildcard character. For example, DependencyCheck* will specify that the rules DependencyCheckAppPoolExists, DependencyCheckFailOnError, DependencyCheckFailOnWarning, and DependencyCheckInUse will be disabled. For more information about rules, see Web Deploy Rules. This setting does not apply to the dump operation.

Example

This example allows content that is stored on UNC paths to be synchronized.

msdeploy -verb:sync -source:appHostConfig="Site1" -dest:appHostConfig="Site1",computerName=DestServer -disableRule:skipUNC

Setting

disableSkipDirective

Usage

-disableSkipDirective:<SkipDirectiveName>

Description

Disables the specified skip directive.

Example

This example disables the skip directive named ConfigProtectedData.

msdeploy -verb:sync -source:appHostConfig="Site1" -dest:appHostConfig="Site1",computerName=DestServer -disableSkipDirective:ConfigProtectedData

Setting

enableLink

Usage

-enableLink:<LinkExtensionName>, <LinkExtensionName>

Description

Enables one or more specified link extensions during a synchronization operation. The link extensions are specified after -enableLink in a comma-delimited list. You can specify the link extension names directly, or use regular expressions that resolve to valid Web Deploy link extension names.

The Web Deploy link extensions are AppPoolExtension, CertificateExtension, ContentExtension, FrameworkConfigExtension, and HttpCertConfigExtension. For more information about link extensions, see Web Deploy Link Extensions. For more information about regular expressions, see Regular Expressions. This setting does not apply to the dump operation.

Example

This example enables the AppPoolExtension so that application pools are included in the sync operation.

msdeploy -verb:sync -source:appHostConfig="Default Web Site" -dest:appHostConfig="Default Web Site",computerName=Server2 -enableLink:AppPoolExtension

Setting

enableRule

Usage

-enableRule:<RuleName>,<RuleName>

Description

Enables one or more synchronization rules during a synchronization operation. The rules are specified after -enableRule in a comma-delimited list. You can specify the rule names directly, or use a regular expression that resolves to valid Web Deploy rules. The specified rule name can also be followed by an asterisk wildcard character. For example, DependencyCheck* will specify that the rules DependencyCheckAppPoolExists, DependencyCheckFailOnError, DependencyCheckFailOnWarning, and DependencyCheckInUse will be enabled. For more information about rules, see Web Deploy Rules. This setting does not apply to the dump operation.

Example

This example applies the rule named "MyCustomSyncRule" to the synchronization operation.

msdeploy -verb:sync -source:archiveDir=c:\archive -dest:webServer -enableRule: MyCustomSyncRule

Setting

enableSkipDirective

Usage

-enableSkipDirective:<SkipDirectiveName>

Description

Enables the specified skip directive.

Example

This example enables the skip directive named ConfigProtectedData.

msdeploy -verb:sync -source:appHostConfig="Site1" -dest:appHostConfig="Site1",computerName=DestServer -enableSkipDirective:ConfigProtectedData

Setting

postSync

Usage

-postSync:<command>

Description

Runs the specified command or batch file on the destination after a synchronization completes. This operation setting uses the runCommand provider. For more information, see Web Deploy runCommand Provider.

Example

This example synchronizes content from the specified source to the specified destination, and then runs the Mybatchfile.bat batch file.

msdeploy -verb:sync -source:contentPath="C:\Test1" -dest:contentPath="C:\Test2" -postSync:runcommand="c:\MyBatchFile.bat"

Setting

preSync

Usage

-preSync:<command>

Description

Runs the specified command or batch file on the destination before a synchronization starts. This operation setting uses the runCommand provider. For more information, see Web Deploy runCommand Provider.

Example

This example runs the Mybatchfile.bat batch file before synchronizing the content from source to destination.

msdeploy -verb:sync -source:contentPath="C:\Test1" -dest:contentPath="C:\Test2" -preSync:runcommand="c:\MyBatchFile.bat"

Setting

removeParam

Usage

-removeParam:<command>

Description

Removes a parameter definition from the list of declared parameters.

Example

This example copies the Myzip.zip package file to the file called Myzip.2.zip, but removes the "MyParam" parameter from the resulting package.

msdeploy -verb:sync -source:package="c:\packages\myzip.zip" -dest:package="c:\packages\myzip2.zip" -removeParam:MyParam

Important

Setting

Note

To change the site ID during a synchronization operation, you can specify the destination with a new site ID. This does not require that you use the replace setting. For example, you can specify a source of metakey=lm/w3svc/1 and a destination of metakey=lm/w3svc/5.

Example

This example replaces the Hello1.png file with the Hello2.png file in the directory for Site2.

msdeploy -verb:sync -source:contentPath=C:\inetpub\Site1 -dest:contentPath=C:\inetpub\Site2 -replace:objectName=contentPath,scopeAttributeName=path,match=Hello1.png,replace=Hello2.png

Setting

retryAttempts

Usage

-retryAttempts:<number>

Description

Specifies the number of times the provider will retry after a failure. <number> specifies the number of retries. The default number of retries is 5. By default, there is a delay of one second between each retry.

Example

This example tries to return the contents of the c:\inetpub folder 8 times, with a one second delay between each attempt.

msdeploy -verb:dump -source:contentPath=c:\inetpub -retryAttempts:8

Setting

retryInterval

Usage

-retryInterval:<milliseconds>

Description

Specifies, in milliseconds, the interval between provider retry attempts. <milliseconds> specifies the number of milliseconds between retries. The default is 1000 (one second).

Example

This example tries to return the contents of the c:\inetpub folder 5 times, with a three-second delay between each attempt.

msdeploy -verb:dump -source:contentPath=c:\inetpub -retryInterval:3000

Setting

setParam

Usage

-setParam:name=<ParameterName>

,kind=<ParameterKind>

,scope=<ParameterScope>

,match=<RegularExpression>

,value=<string>

,description=<ParameterDescription>

Description

Specifies values during a sync operation for the parameters that you specify. The parameters may have been declared for a package or archive by using -declareParam. You can use -setParam with any provider. This setting does not apply to the dump operation. For more information about using parameters, see Using declareParam and setParam.

Example

This example sets the "param" parameter to the value "MyDefaultWebPage.htm" and synchronzies the ParameterPackage.zip file to its destination.

msdeploy -verb:sync -source:package=ParameterPackage.zip -dest:auto -setParam:name=param,value=MyDefaultWebPage.htm

Setting

setParamFile

Usage

-setParamFile:<XMLFile>

Description

Applies parameter settings from an XML "answer" file during a sync operation. The <XMLFile> provides the names of the parameters and the values to which they are to be set. Parameter "answer" files let you store and reuse sets of predetermined parameter values based on the requirements of a particular environment (for example, test, staging, or production.) For information about using parameters on the command-line, see Using declareParam and setParam.

Example

This example synchronizes the MyPackage.zip file to the computer named Server1. The values for the parameters that are defined in the package are specified by a file named StagingParameters.xml.

msdeploy -verb:sync -source:package="c:\packages\mypackage.zip" -dest:auto,computername=StagingServer1 -setParamFile="c:\StagingParameters.xml"

Example parameter file contents follow.

<parameters>

    <setParameter name="SQLServer" value="StagingServer1" />

</parameters>

Setting

showSecure

Usage

-showSecure

Description

When specified, displays encrypted configuration properties (such as passwords) in clear text when the output format is XML. When not specified, encrypted configuration properties will be hidden with asterisks in the XML output.

Example

This example displays the attributes of the application pool named "MyEncryptedAppPool" in XML format. The -showsecure operation setting specifies that password for the application pool will be displayed in clear text.

msdeploy -verb:dump -source:apppoolconfig="MyEncryptedAppPool" -xml -showsecure

Important

Setting