Backup IIS Configuration Settings via PowerShell

04/01/2010

PowerShell

One of the best practices for backing up SharePoint is to include the configuration settings of IIS. This information is important as the backup creates several files that can be later used during disaster recovery to restore or reconfigure your farm. Prior to PowerShell, you would have run iisback.vbs to backup your IIS settings. However, now that you are a PowerShell Pro, let’s backup IIS via PowerShell!

In order to use IIS PowerShell commands, you must have the IIS (WebAdministration) module loaded. You can view my previous post on how to do that, if you need assistance.

First, let’s take a look at the help information for the command we will be utilizing to perform the backup of IIS: Backup-WebConfiguration

Take note of: “A folder named with the value of the Name parameter is created for the backup in the $env:windir\System32\inetsrv\backup folder.”

So, all we need to do is run the command with the Name parameter for the folder we want to store our backup files.

Locate the newly created folder within %windir%\System32\inetsrv\backup.
Tip: Just type explorer $env:windir\system32\inetsrv\backup to get there from PowerShell

You should see five files located within the folder.

If you edit applicationHost.config in notepad, then you will see the settings stored for your application pools and web sites: (ignore my horrible highlighting skills)

 

You are done! Now, since this is for disaster recovery, you probably want to move these files off this server and/or make sure this folder is included in your file system backup strategy.

Advertisements

Subscribe

Subscribe to our RSS feed and social profiles to receive updates.

One Comment on “Backup IIS Configuration Settings via PowerShell”

  1. Bjørn Roalkvam Says:

    Nice write-up Adam.
    Will this include IIS certificates also?
    best regards
    Bjorn

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: