Backup-WDServer:如何指定加密密码

时间:2013-01-10 19:55:44

标签: iis powershell msdeploy iis-8 cmdlet

我读到了Web Deploy Powershell Cmdlets,我想开始使用它们。当然,我开始的第一项任务是备份我的测试网络服务器的当前配置状态 - 这个cmdlet应该这样做:

Backup-WDServer -ConfigOnly

但是,当我运行它时,我得到了这个投诉 - 我不确定如何解决它:

Backup-WDServer : The property 'password' located at '/webServer/appHostConfig[@path='']/location[@path='']/section[@name='system.applicationHost/applicationPools']/applicationPools/applicationPoolDefaults/processModel' is 
marked as secure. You must specify an encryption password to archive this property.
At line:1 char:1
+ Backup-WDServer -ConfigOnly
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Backup-WDServer], DeploymentEncryptionException
    + FullyQualifiedErrorId : Microsoft.Web.Deployment.PowerShell.BackupServer

3 个答案:

答案 0 :(得分:5)

我无法找到文档,但在花了很多时间与IL DASM,在问题中提供的链接中阅读更多内容并进行实验后,我发现这有效:

Backup-WDServer -SourceSettings @{encryptPassword='password'} -ConfigOnly

如果有人有更完整文档的链接,我会很感激 - 但Bing和Google并没有找到太多。

答案 1 :(得分:1)

这是一个旧线程,但有答案:

Restore-WDServer -DestinationSettings @{encryptPassword='password'} -Package /path/to/the/zip/file

答案 2 :(得分:-1)

如何为Restore-WDServer设置encryptpassword?如果你这样做来备份

备份-WDServer -SourceSettings @ {encryptPassword ='密码'} -ConfigOnly