if ((Get-PSSnapin
-Name Microsoft.SharePoint.PowerShell
-ErrorAction SilentlyContinue)
-eq $null
)
{Add-PSSnapin Microsoft.SharePoint.Powershell}
$OrpCnt = Get-SPContentDatabase
ForEach ($Orp
in $OrpCnt)
{
$Sts = Get-SPWebApplication -Limit All | Get-SPSite
Write-Host "Detecting Orphans for " $Orp.Name $Sts.Name $Orp.Repair($false)
Write-Host "Detecting Orphans for " $Orp.Name $Sts.Name $Orp.Repair($false)
}
Get-SPWebApplication -Limit All | Get-SPSite | Format-Table -Property URL,ContentDatabase
No comments:
Post a Comment