Condividi tramite


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

3) This example skips the requirement that where Windows authentication applies to a source object, it must also apply to the corresponding destination object.

msdeploy -verb:sync -source:webServer -dest:webServer,computerName=DestServer -skip:objectName=windowsAuthentication

4) This example instructs Web Deploy not to delete registry keys on the destination that do not exist in the source package.

msdeploy -verb:sync -source:package=C:\package.zip -dest:webServer,computerName=DestServer -skip:skipAction=Delete,objectName=regKey

Setting

source

Usage

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

Description

Specifies the source of the data for the operation that the -verb argument specifies. The <provider> and its associated settings more narrowly define the source 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 displays, in XML format, the configuration information of the default application pool.

msdeploy -verb:dump -xml -source:apppoolconfig="DefaultAppPool"

Note

Setting

Example

This example displays configuration information for the default Web site on Server2. The sample username and password are in Japanese, so the -unicode setting is specified.

msdeploy -verb:dump -source:appHostConfig="Default Web Site",computerName=Server2,username="太郎",password="秘密" -unicode

Setting

useCheckSum

Usage

-useCheckSum

Description

Specifies that files will be compared by using their CRC (Cyclic Redundancy Check) checksum and ignoring their last write time. This setting is useful when you want to copy only the files whose content has changed, and ignore files that have the same content but different time stamps.

Example

This example specifies that the synchronization will be performed by comparing the checksum of the source and destination files, and not their last write time.

msdeploy -verb:sync -source:contentPath="C:\Test1" -dest:contentPath="C:\Test2" -usechecksum

Setting

verb

Usage

-verb:[sync|dump|delete]

Description

Specifies the action that the operation will perform. A sync operation synchronizes a destination object so that it becomes identical to the source object. The sync operation requires both the source and dest arguments. A dump operation displays information about the object specified by the source argument. A delete operation deletes the object or objects specified by the dest argument. For more information about sync, dump, and delete, see Web Deploy sync Operation, Web Deploy dump Operation, and Web Deploy delete Operation.

Example

This example displays configuration information for App1 of the Fabrikam Web site.

msdeploy -verb:dump -source:appHostConfig="Fabrikam/App1" -xml

Setting

verbose

Usage

-verbose

Description

Specifies that the Informational verbosity level will be included in the output of the operation. By default, the verbosity levels of Warning, Error, and Fatal are included. The Informational verbosity level will return all messages that are triggered during an operation.

Example

This example displays all messages during the synchronization of Site1 and Site2.

msdeploy -verbose -verb:sync -source:contentPath=C:\Inetpub\Site1 -dest:contentPath=C:\Inetpub\Site2

Setting

webServerDir

Usage

-webServerDir=<DirectoryPath>

Description

Specifies the path of the program files for the current instance of IIS Express. The default path is %SystemDrive%\Program Files\Microsoft WebMatrix.

Example

Synchronize a WordPress site from the computer IISWebServer1 to a computer that has IIS Express. Use the program files for IIS Express that are located in the Microsoft WebMatrix folder on drive d.

msdeploy -verb:sync -source:webApp="wordpress",computername=IISWebServer1 -dest:auto -webserverdir="d:\program files\microsoft webmatrix"

Warning

Setting

Example

This example displays what would occur if Site1 and Site2 were synchronized.

msdeploy -whatif -verb:sync -source:contentPath=C:\Inetpub\Site1 -dest:contentPath=C:\Inetpub\Site2

Setting

xml

Usage

-xml

Description

Specifies that the output should be returned in XML format. The returned XML contains all object attributes. The default output returns only the path of the object and does not include all the attributes of the object.

Example

This example displays all the configuration information for the default Web site, including attributes.

msdeploy -verb:dump -source:appHostConfig="Default Web Site" -xml

Setting

xpath

Usage

-xpath:<path>

Description

<path> specifies an XPath expression to apply to XML output.

Example

This example displays the merged configuration for a Web site that has an ID attribute that has the value of 4.

msdeploy -verb:dump -source:webServer -xml -xPath://site[@id=4]

See Also

Web Deploy Command Line Syntax

Web Deploy Operations

Web Deploy Link Extensions

Web Deploy Rules

Web Deploy Providers

Web Deploy Provider Settings