001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046 047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064 065 066 067 068 069 070 | function Get-SPFeatureActivated { # see full script for help info, removed for formatting [CmdletBinding()] param( [Parameter(position = 1, valueFromPipeline=$true)] [string] $Identity )#end param Begin { # load SharePoint assembly to access object model [void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") # declare empty array to hold results. Will add custom member for Url to show where activated at on objects returned from Get-SPFeature. $results = @() $params = @{} } Process { if([string]::IsNullOrEmpty($Identity) -eq $false) { $params = @{Identity = $Identity} } # create hashtable of farm features to lookup definition ids later $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local # check farm features $results += ($farm.FeatureDefinitions | Where-Object {$_.Scope -eq "Farm"} | Where-Object {[string]::IsNullOrEmpty($Identity) -or ($_.DisplayName -eq $Identity)} | % {Add-Member -InputObject $_ -MemberType noteproperty -Name Url -Value ([string]::Empty) -PassThru} | Select-Object -Property Scope, DisplayName, Id, Url) # check web application features $contentWebAppServices = $farm.services | ? {$_.typename -like "Windows SharePoint Services Web Application"} foreach($webApp in $contentWebAppServices.WebApplications) { $results += ($webApp.Features | Select-Object -ExpandProperty Definition | Where-Object {[string]::IsNullOrEmpty($Identity) -or ($_.DisplayName -eq $Identity)} | % {Add-Member -InputObject $_ -MemberType noteproperty -Name Url -Value $webApp.GetResponseUri(0).AbsoluteUri -PassThru} | Select-Object -Property Scope, DisplayName, Id, Url) # check site collection features in current web app foreach($site in ($webApp.Sites)) { $results += ($site.Features | Select-Object -ExpandProperty Definition | Where-Object {[string]::IsNullOrEmpty($Identity) -or ($_.DisplayName -eq $Identity)} | % {Add-Member -InputObject $_ -MemberType noteproperty -Name Url -Value $site.Url -PassThru} | Select-Object -Property Scope, DisplayName, Id, Url) # check site features in current site collection foreach($web in ($site.AllWebs)) { $results += ($web.Features | Select-Object -ExpandProperty Definition | Where-Object {[string]::IsNullOrEmpty($Identity) -or ($_.DisplayName -eq $Identity)} | % {Add-Member -InputObject $_ -MemberType noteproperty -Name Url -Value $web.Url -PassThru} | Select-Object -Property Scope, DisplayName, Id, Url) $web.Dispose() } $site.Dispose() } } } End { $results } } #end Get-SPFeatureActivated Get-SPFeatureActivated |
PowerShell Script To Find Where SharePoint 2007 Features Are Activated
New on Geeks with Blogs
- Because of AI, You Need a New Development Team
Your existing team is buried in the complexity of your existing product. AI rewards the team with a blank slate. Most companies don't have one.
- The Offshore Problem That Starts With a "Yes"
The stories about offshore "not working" are rarely about skill. They are about an invisible communication gap, and it starts the moment someone says yes.
- The Focus Five: Five Questions to Know If Your Team Is Actually Making Progress
Almost nobody trains you to be an engineering manager. You were good at writing code, so you got handed more people and more meetings, and one day the job was leading a team instead of shipping fea…
- Why Nobody Knows What Engineering Does
At VinSolutions, I was famous for one thing that had nothing to do with writing code. Every single time we shipped a release, I posted about it. On social media, to customers, inside the company, a…
