PowerShell ile SharePoint'teki Tüm Etkin Olmayan Özellikleri Bulun
SharePoint'te etkin olmayan Özellik nedir? Peki, hiçbir yerde yüklü ancak etkinleştirilmemiş özellikler!
SharePoint için etkin olmayan özellikleri bulmak için PowerShell betiği:
Add-PSSnapin "Microsoft.SharePoint.Powershell" -ErrorAction SilentlyContinue
$InactiveFeatures = @()
#Get All installed features on respective scopes
$WebAppFeatures = Get-SPFeature | Where-Object {$_.Scope -eq "WebApplication" }
$siteFeatures = Get-SPFeature | Where-Object {$_.Scope -eq "Site" }
$WebFeatures = Get-SPFeature| Where-Object {$_.Scope -eq "Web" }
Write-host "Checking Web Application Scoped Features..."
foreach ($WebAppFeature in $WebAppFeatures)
{
$Flag = $False
foreach ($WebApp in Get-SPWebApplication)
{
if ((Get-SPFeature -WebApplication $WebApp.URL | Where-Object {$_.Id -eq $WebAppFeature.id}) -ne $null)
{
#We found that the Feature is active, Lets end up the loop
$Flag = $True
break
}
}
if($Flag -eq $False)
{
Write-Host "$($WebFeature.DisplayName) is not Active on any Web Application!)"
}
}
Write-Host "`nChecking Site Collection Scoped Features..."
foreach ($SiteFeature in $SiteFeatures)
{
$Flag = $False
:WebAppLoop1 foreach ($WebApp in Get-SPWebApplication)
{
foreach($site in $WebApp.Sites)
{
if ((Get-SPFeature -Site $Site.URL | Where-Object {$_.Id -eq $SiteFeature.id}) -ne $null)
{
#We found that the Feature is active, Lets end up the loop
$Flag = $True
break WebAppLoop1
}
}
}
if($Flag -eq $False)
{
Write-Host "$($SiteFeature.DisplayName) is not Active on Any Site Collection!"
}
}
Write-host "`nChecking Web Scoped Feature..."
foreach ($WebFeature in $WebFeatures)
{
$Flag = $False
#I'm limiting to a single web application, Remove ""https://sharepoint.crescent.com" to process all WebApps
:WebAppLoop2 foreach ($WebApp in Get-SPWebApplication "https://sharepoint.crescent.com")
{
foreach($Site in $WebApp.Sites)
{
foreach($Web in $Site.AllWebs)
{
if ((Get-SPFeature -Web $Web.URL | Where-Object {$_.Id -eq $WebFeature.id}) -ne $null)
{
#We found that the Feature is active, Lets end up the loop
$Flag = $True
break WebAppLoop2
}
}
}
}
if($Flag -eq $False)
{
Write-Host "$($WebFeature.DisplayName) is not Active on Any Web!"
}
}
Lütfen unutmayın: Kullandığımız site şablonuna bağlı olarak Etkin Olmayan birçok OOTB özelliği olabilir. Bu nedenle, SharePoint 2013/SharePoint 2010 ortamlarına dağıtılan özel özelliklerinize ilişkin fikir edinmek için bu betiği kullanın.
Çeşitli kapsamlarda etkinleştirilen özellikler hakkında rapor almak için şuraya bakın: PowerShell kullanarak SharePoint Özellikleri Kullanım Raporu