PowerShell

8 posts

Delete Page Layouts / Master Pages by PowerShell Script

In one of my projects we needed a PowerShell script for deleting an unnecessary page layout for all web application. Here is the script that I wrote. This is not only for page layouts, it can be used for masterpages. param ( [string]$WebApplicationUrl = “”, [string]$PageLayoutName = “” ) Remove-PSSnapin […]

Mask created/modified users in lists/libraries

You might want to hide created by and modified by information from the users. There are three ways to achieve this. First to way is masking the created by and modified by users in lists and libraries. Third one is actually a workaround by creating a new view which doesn’t […]

Save SharePoint 2013 Publishing Site as Template

Microsoft is restricted saving SharePoint 2013 Publishing sites as templates. Here is the information you can find on Microsoft Support pages (http://support.microsoft.com/kb/2492356) SharePoint does not support Save Site as Template option with the Publishing features turned on. The supported method to create templates for publishing sites is to use a site definition template and […]

PowerShell: Changing the Distributed Cache Service Managed Account

Changing managed account used for “Distributed Cache Service” is one of the things that cannot be done using the SharePoint Central Administrator. So as central admin advises you navigate to Security -> General Security -> Configure Service Accounts, find the “Distributed Cache Service” and select another managed account, it gives […]

Changing Site Collection Administrators using PowerShell

Site collections can have two administrators and you can modify them through SharePoint Central Administration. But if you need to change these admins using PowerShell script you can use the following PowerShell function. I filtered site collections with the url to find the appropriate site collection. You can define a parameter […]

Change Farm Level Property Bag using PowerShell

Property bag is simply thw properties of web site, site collection, web application and farm. So in order to interact with the PropertyBags in PowerShell, just use the related object’s Propeties member. In the following example I used the farm object’s Properties member to edit farm level property bag. So you […]

Batch Solution Deploy using PowerShell

Nowadays I’m working on a SharePoint deployment project using Advanced Installer, AutoSPInstaller and custom PowerShell scripts. One of that script deploys a set of solution packages in a given order. Order is important if you have dependencies between the solutions. So I defined  the name of the solutions and the order of them in a xml file. In […]

Windows PowerShell Command Builder for SharePoint 2010

Thanks to my team for introducing me this powershell command builder tool which is developed by Microsoft. It makes easy to write PowerShell commands for SharePoint 2010. The Windows PowerShell Command Builder for Microsoft SharePoint 2010 Products and Microsoft Office 365 is a Silverlight 4 application that is designed to […]