Activate SharePoint ShortUrl Features to all Sites

SharePoint ShortUrl Features are Activated on a Site by Site basis. The Below PowerShell Script will enable the selected SharePoint ShortUrl Features to all Sites within a specified Web Application on which SharePoint ShortUrl is Activated.

Please refer to the SharePoint ShortUrl 2013 Features & Commands List to get the correct Feature names that you require (Activation Command (column) > -Identity).

 

————————- PowerShell Script / edit as required————————-

 

$webapp = Get-SPWebApplication “https://webapp

$sites = $webapp | Get-SPSite -Limit All

$webs = $sites | Get-SPWeb -Limit ALL

$shorturlactivationId = $(Get-SPFeature -limit all | where {$_.displayname -eq “ShortUrl2013_ShortUrlECMLink”}).Id

$shorturleventreceiverautoupdateId = $(Get-SPFeature -limit all | where {$_.displayname -eq “ShortUrl2013_ShortUrlEventReceiver-AUTOUPDATE”}).Id

$shorturlshowmyshorturlId = $(Get-SPFeature -limit all | where {$_.displayname -eq “ShortUrl2013_ShortUrlShowMyShortUrls”}).Id

$webs | % {Enable-SPFeature $shorturlactivationId -Url $_.Url}

$webs | % {Enable-SPFeature $shorturleventreceiverautoupdateId -Url $_.Url}

$webs | % {Enable-SPFeature $shorturlshowmyshorturlId -Url $_.Url}