SharePoint 定期备份网站

代码如下,请保存为人后辍名为ps1,用PowerShell来执行

$snapin = Get-PSSnapin | where-object { $_.Name -eq
'Microsoft.SharePoint.PowerShell' }
if ($snapin -eq $null){
write-host "Loading SharePoint PowerShell Snapin..." -foregroundcolor Blue
add-pssnapin "Microsoft.SharePoint.PowerShell"
write-host "SharePoint PowerShell Snapin loaded." -foregroundcolor Green
}


$File=Get-Date -Format "yyyyMMddHHmmss" 
$File="c:\Backup\84Port"+$File+".bak"
Write-Host $File
Backup-SPSite http://ssp:84 -Path  $File
原文地址:https://www.cnblogs.com/gzh4455/p/2788548.html