IIS WebDeploy Export Server Package via Powershell

Go To StackoverFlow.com

3

I am curious how to create an "export server package" via powershell commands to IIS manager.

Here is my scenario: When I deploy our .NET software builds (and Flex, etc) to our web server, I normally do this process manually: I open up IIS Manager and follow the "Export Server Package" wizard (which creates a zip file of the entire IIS structure - contents and all). Then I archive this new zip file that was produced (for backup purposes). The zip file is helpful if our web server becomes unresponsive or disappears in "the cloud"! A IIS backup zip file allows us to "roll out" quickly.

My question is...how can I accomplish exporting of a server package with Powershell scripts (instead of manually)? I cannot find much on this topic on the web!!

I have looked at the MS Deploy verbs (as covered here: http://raquila.com/software/ms-deploy-basics/) but I do not see one for an "Export" verb/action??

Any help is appreciated. My ultimate goal is to produce the server package via powershell, and upload to Amazon S3 cloud for safe keeping. The S3 cloud stuff is easy, it's the powershell to IIS script I am having problems with...

2012-04-04 19:19
by D3vtr0n


4

I can't see a great way of doing this with just PowerShell cmdlets. What I would suggest is using PowerShell to call appcmd to export the application settings and then grab a copy of the files used. Then I'd throw these in an S3 bucket, also through PowerShell.

2012-04-05 13:33
by Chris N
I am really hoping to avoid re-inventing the wheel here though. Microsoft really needs to support this, it would be a great feature IMO - D3vtr0n 2012-04-05 16:56
Right - I like how the Exchange team works in that respect. Everything in the GUI is just a switch for a cmdlet. When you hit finish, it runs a PowerShell command and shows you what it did. If everything was like that we'd be able to admin things much more efficiently - Chris N 2012-04-05 18:35


2

Are you using anything to build the artifacts (ie: bamboo or teamcity?) If straight from VisualStudio use the AWS ToolKit: http://aws.amazon.com/visualstudio/

For deploys: I would focus on getting the artifacts pushed to S3 in some automated fashion (if at all possible). Once you get the artifacts in S3, work on your plan to use those artifacts again. Are they for bootstrapping new instances/servers from S3? Are they backups for DR purposes?

For example, we build using Bamboo and within Bamboo we can create a deployment plan with Tasks to execute. One of these includes uploading to S3.

**Checkout the following powershell cmdlets: http://www.iis.net/learn/publish/using-web-deploy/web-deploy-powershell-cmdlets

2015-05-06 01:54
by user206203
It has definitely become much easier to do these types of things. I simply wanted to reproduce the "Export-Server" in IIS via a Powershell.script. I have never used Bamboo but that sounds like a better route anyways. I was just curious how to reproduce IIS functionality via Powershell. I can see how to reproduce the structure via DOS (the hard way), I was just hoping to find an easy Powershell function or script handy - D3vtr0n 2015-05-07 05:02
Checkout the Webeploy Powershell Cmdlets at http://www.iis.net/learn/publish/using-web-deploy/web-deploy-powershell-cmdlet - user206203 2015-05-08 06:15
Nice! That was published 15 days after I posted this question. Very nice read...I wanna mark it as the answer, can you put it in your response - D3vtr0n 2015-05-14 01:41
Ads