Last active
December 16, 2015 01:38
-
-
Save devendrasv/eaed17f9c4e1d0e2ecfc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Example of getting site collection url based on feature Name | |
Add-PSSnapin Microsoft.SharePoint.PowerShell | |
$webapp= Get-SPWebApplication "http://www.sharepoint-journey.com/" | |
# looping through all sitecollections | |
foreach($site in $webApp.Sites) | |
{ | |
#Get the feature based on display name | |
$feature=Get-SPFeature -Site $site | Where-object {$_.DisplayName -eq "Branding"} | |
if($feature -ne $null) | |
{ | |
# Disply the site site collection URL | |
Write-host "Feature Activated at" $site.Rootweb.URL | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment