In this PowerShell tutorial, we will discuss how to perform IIS backup using PowerShell.
IIS backup and restore using PowerShell
If you are using IIS7 then there is a PowerShell command to backup your IIS data.
Please follow the below steps to take the Backup of your IIS.
Backing up an IIS configuration
Step 1: Log in to Windows Powershell using Administrator mode.
Step 2: Next copy the below command and paste it into Powershell and click on enter to execute the command
Backup-WebConfiguration -Name RAJIISBACKUP
Step 3: After execute this command by default Backups are stored in the
Restores an IIS configuration backup
Now, we will see how to restore an IIS configuration backup using PowerShell.
Restore-WebConfiguration -Name RAJIISBACKUP
Note: Please take care while providing the name of your backup file. If the filename already exists, then it will return an error. So make sure you are providing the unique backup name.
This is how we can do IIS backup and restore using PowerShell.
You may like the following tutorials:
- How to check server health status check using PowerShell in SharePoint
- The term Get-SPweb is not recognized as the name of a cmdlet function script file or operable program error in SharePoint PowerShell
- Get SharePoint List Name and GUID using PowerShell and CSOM
Rajkiran is currently working as a SharePoint Consultant in India . Rajkiran having 7+ years of experience in Microsoft Technologies such as SharePoint 2019/2016/2013/2010, MOSS 2007,WSS 3.0, Migration, Asp.Net, C#.Net, Sql Server, Ajax, jQuery etc.He is C#Corner MVP (2 Times).