Disk space filling up on Web Front End servers
I have several web front end servers in a SharePoint 2013 farm and disk space on the C: drive seems to get eaten quite quickly. By using TreeSize I was able to locate a temporary folder used by IE that…
Prevent site collection administrators from upgrading site collections
If you are upgrading from SharePoint 2010 to SharePoint 2013, and you need to prevent site collection administrators from upgrading site collections, then you can disable Self Service Upgrades using the Get-SPSite cmdlet: $portal = Get-SPSite “http://portal.lab.local” $portal.AllowSelfServiceUpgrade = False…
Ensure a purchased app is available in all site collections
I have purchased an app and need to make sure it s available in all site collections within a web application. Firstly I import the app package using the Import-SPAppPackage cmdlet: $spapp = Import-SPAppPackage -Path C:\MyApp.spapp -Site http://portal.lab.local -Source Marketplace Then…
PowerShell script to list sites that have a specified feature enabled
The following PowerShell script will enumerate all sites within a Site Collection and report on where a particular feature has been enabled using the Get-SPWeb cmdlet. In the example I am reporting on the SharePoint Server Enterprise Site Features feature…
SharePoint 2013 – Request an upgrade evaluation site collection
If you have a site collection that is in SharePoint 2010 mode you can create a temporary upgrade evaluation site collection using the Request-SPUpgradeEvaluationSite cmdlet. Here is an example of how this would look: Request-SPUpgradeEvaluationSite -Identity http://portal.lab.local/sites/sp2010site By default the…
PowerShell script to report the last modified date for all sites within a site collection
In response to a post on the Microsoft TechNet Forums I wrote the following script to report the last modified date for all sites within a site collection using the Get-SPSite and Get-SPWeb PowerShell cmdlets. $SiteCollection = Get-SPSite https://yoursite.yourdomain.local ForEach($Site in…
Only allow sites to be created with SharePoint 2013 compatibility level
If you have a requirement to only allow sites within a web application to be created with a compatibility level of SharePoint 2013 then you can configure this using only a few PowerShell commands: $wa = Get-SPWebApplication http://portal.webbworld.local $wa.CompatibilityRange =…
SharePoint 2013 – URL mappings for Host Named Site Collections
The only way to add a URL mapping to a Host Named Site Collection is by using PowerShell and the Set-SPSiteURL cmdlet. Below is an example of how to add a URL to an existing site collection: $Site = Get-SPSite ‘https://intranet.webbworld.local’…
SharePoint 2013 – creating a host named site collection using PowerShell
The only way to create a Host Named Site Collection (HNSC) is using PowerShell and the New-SPSite cmdlet. Below is an example of how to do this: New-SPSite -URL “https://doc-centre.webbworld.local” -HostHeaderWebApplication “https://portal.webbworld.local” -Name “Doc Centre” -Description “WebbWorld Document Centre” -Template…
SharePoint 2013 – update a custom solution without having to retract the previous version
If you need to update a custom solution without having to retract the previous version you can do this using the Update-SPSolution PowerShell cmdlet: Update-SPSolution -Identity MySolution.wsp -LiteralPath C:\MySolution.wsp -GACDeployment