rilpoint_mw113

Backup IIS

<-- Maintenance

Concept from nbsp article

On a SharePoint Server:

Import-Module WebAdministration
Backup-WebConfiguration -Name SharePoint_IIS_Backup

To see the backup:

start-process C:\Windows\System32\inetsrv\backup

To restore a backup:

Restore-WebConfiguration -Name SharePoint_IIS_Backup

A sample full script

# Import the Web Administration module to get Backup-WebConfiguration cmdlet
Import-Module WebAdministration
 
#Define some variables. $Suffix gets the number day, like "15"
$suffix = (Get-Date).Day
$name = "SharePoint_IIS_Backup." + $suffix
 
#Perform the backup
Backup-WebConfiguration -Name $name
 
#Remove all items from backup folder except the one we just created
Remove-Item $env:Windir\System32\inetsrv\backup\* -Exclude $name -Recurse -Force
 
#Copy over to another server (optional). You could also back this up using backup software.
Robocopy $env:Windir\System32\inetsrv\backup \\server2\D$\Backups\IIS_Backups /Z /S
Skin by RIL Partner