代码如下,请保存为人后辍名为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

 

posted on 2012-11-26 09:43  gzh4455  阅读(125)  评论(0编辑  收藏  举报