1

Can I find just third-party features with Powershell?

I other words, I want to create an inventory with all features that not come originally from Sharepoint installation.

3

I would use the Get-SPFeature Cmdlet to get all the features

http://www.glynblogs.com/2010/08/powershell-commands-to-list-sharepoint-features.html

and and store the values in a list. Then create a parallel list using the list of known GUIDs for SharePoint Features.

for SharePoint 2013. http://social.technet.microsoft.com/wiki/contents/articles/14423.sharepoint-2013-existing-features-guid.aspx

Then remove the known GUIDs from the original list. By process of elimination you should have your 3rd party apps.

This approach could take some work becaue you'll have to copy the know GUIDs and then store them in a text file or Access DB and read them in.

Here is some code that might do the trick.

$counter = 0  
$guid = @()
$index = @()
$third_party = @()
$position = 0

$Current_features = Get-SPFeature <# Gets all the currently installed features

<# Truncated list from http://social.technet.microsoft.com/wiki/contents/articles/14423.sharepoint-2013-existing-features-guid.aspx  #>
<# I just highlighted the table and copy and pasted into the $baseline string #>

$baseline = "
AbuseReportsList     c6a92dbf-6441-4b8b-882f-8d97cb12c83a    Web
AccessRequests   a0f12ee4-9b60-4ba4-81f6-75724f4ca973    Web
AccSrvApplication    1cc4b32c-299b-41aa-9770-67715ea05f25    Farm
AccSrvMSysAso    29ea7495-fca1-4dc6-8ac1-500c247a036e    Web
AccSrvRestrictedList     a4d4ee2c-a6cb-4191-ab0a-21bb5bde92fb    Web
AccSrvShell  bcf89eb7-bca1-4468-bdb4-ca27f61a2292    Web
AccSrvSolutionGallery    744b5fd3-3b09-4da6-9bd1-de18315b045d    Site
AccSrvSolutionGalleryStapler     d5ff2d2c-8571-4c3c-87bc-779111979811    Farm
AccSrvUserTemplate   1a8251a0-47ab-453d-95d4-07d7ca4f8166    Web
AccSrvUSysAppLog     28101b19-b896-44f4-9264-db028f307a62    Web
AccSvcAddAccessApp   d2b9ec23-526b-42c5-87b6-852bd83e0364    Web
AccSvcAddAccessAppStapling   3d7415e4-61ba-4669-8d78-213d374d9825    Farm
AccSvcApplication    5094e988-524b-446c-b2f6-040b5be46297    Farm
AccSvcShell  7ffd6d57-4b10-4edb-ac26-c2cfbf8173ab    Web
AddDashboard     d250636f-0a26-4019-8425-a5232d592c09    Web
AdminLinks   fead7313-ae6d-45dd-8260-13b563cb4c71    Web
AdminReportCore  b8f36433-367d-49f3-ae11-f7d76b51d251    Site
AdminReportCorePushdown  55312854-855b-4088-b09d-c5efe0fbf9d2    Farm
"

$baseline = $baseline.Split("`n")  <# Splits the big string by carriage return #>
foreach ($item in $baseline){  <# Creates list of GUIDs from text#>
$item = $item.Split()
$guid = $item[2]

<# Gets the matching entries from $current_features that match the list for easier comparison. #>
foreach ($feature in $Current_features){ 
if ($guid -eq $feature.id){
$index = $index + $feature

}
} <# End of Baseline GUID loop #>
} <# End of main loop#>

<# Compares the two lists and outputs the difference which should be thirdpart apps #>
Compare-Object -ReferenceObject $Current_features -DifferenceObject $index -PassThru

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.