SharePoint 2010: Backup and Restore IIS Web Server Configuration Through PowerShell

Backing up SharePoint 2010 IIS Web Server configuration is such an important administrative task that every SharePoint administrator should know the steps. Additionally it's a part of your disaster recovery plan that you need to document carefully

SharePoint 2010 is running on IIS 7. Web Server with a good deal of configuration information and settings of Application pools, Web applications that are indispensable to  the life of your SharePoint environment and SharePoint administrator. Therefore, backing up SharePoint 2010 IIS Web Server configuration is such an important administrative task that every SharePoint administrator should know the steps. Additionally, it's a part of your disaster recovery plan that you need to document carefully.

In this post, I will use PowerShell, which is a useful tool for Windows Server administrator, to backup IIS Web server configuration.

Above all, the one thing you have to do is to add IIS PowerShell snapin into SharePoint Server through this post. However, you can import the module WebAdministration that is supported for IIS PowerShell Administrative tasks. In case you do not know modules, you can use the following command:

Get-module -listAvailable

Suppose you do not know how to import modules. You can use Get-Help, which is the powerful cmdlet in Windows PowerShell. Type the following command:

Get-Help *-module

In the list, you can learn how to import a module by using Import-Module cmdlet. If you do not fully know how to use Import-Module cmdlet, you can use the following command:

Get-Help Import-Module -example

After learning by above command, you will use the following command in order to import module.

Import-Module WebAdministration

Suppose again you do not know any commands of the WebAdministration module, you can employ Get-Command cmdlet, which is introduced in the previous post to list all commands of WebAdministration.

Get-Command -PSSnapin WebAdministration

You continue to employ the Get-Help cmdlet by using the following command:

Get-Help Backup-WebConfiguration -example

You now know how to backup IIS Web Configuration through PowerShell by the following command:

Backup-WebConfiguration -Name SharePoint_IIS_Backup

You need to check the result by navigating the following path:

\Windows\System32\inetsrv\backup

In order to restore your backup file, you can use the following command:

Restore-WebConfiguration -Name SharePoint_IIS_Backup

Summing up

  • Backing up/restoring IIS Web configuration and setting are important tasks that SharePoint administrators need to do. Also, they allow you to prevent disaster as well as make SharePoint alive.
  • Get-Help is the powerful cmdlet that SharePoint PowerShell absolute beginners need to use fluently.