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.
10/11/2013 at 7:19 am
Nice write-up Adam.
Will this include IIS certificates also?
best regards
Bjorn