Skip to main content

Set Custom Master Page for All subsites using Poweshell Command

Set Custom Master Page for All subsites

$site = Get-SPSite http://serverurl/
$site | Get-SPWeb -limit ALL | ForEach-Object {$_.MasterURL =  "/_catalogs/masterpage/custom.master";$_.Update()}
$site.Dispose()



PS C:\Users\Triad> Get-SPWeb -identity http://serverurl/ | Format-T
able -property MasterURL
MasterUrl
---------
/_catalogs/masterpage/Custom.master

PS C:\Users\Triad> Get-SPWeb -identity http://serverurl/ | Get-Memb
er

   TypeName: Microsoft.SharePoint.SPWeb
Name                                  MemberType Definition
----                                  ---------- ----------
AddApplicationPrincipal               Method     Microsoft.SharePoint.SPUser...
AddProperty                           Method     System.Void AddProperty(Sys...
AddSupportedUICulture                 Method     System.Void AddSupportedUIC...
AllowAllWebTemplates                  Method     System.Void AllowAllWebTemp...
ApplyTheme                            Method     System.Void ApplyTheme(stri...
ApplyWebTemplate                      Method     System.Void ApplyWebTemplat...
BreakRoleInheritance                  Method     System.Void BreakRoleInheri...

Comments

Popular posts from this blog

SharePoint Farm Installation

Windows Cluster : http://technet.microsoft.com/en-us/library/bb727114.aspx http://blogs.msdn.com/b/clustering/archive/2008/01/18/7151154.aspx SQL Cluster : http://clusteringformeremortals.com/2009/10/07/step-by-step-configuring-a-2-node-multi-site-cluster-on-windows-server-2008-r2-%E2%80%93-part-3/ Network Load Balancing http://www.jppinto.com/2009/05/install-and-configure-wlbs-nlb-on-windows-server-2008/ SharePoint 2010 Farm Installation http://www.khamis.net/blog/Lists/Posts/Post.aspx?ID=48

How to store the sharepoint List or List Item within the recycle bin of the site while deleting it programmatically ?

Whenever we delete a sharepoint list or list item from the User Interface it get stored within the recycle bin of the site. But when we delete it programmatically it get's deleted permanently. So what we can do to store the List or List Item within the recycle bin while deleting it programmatically ? Generally we use the list.Delete() or item.Delete() method to delete the list or item. Instead of using the Delete() method we can use the Recycle() method i.e list.Recycle() or item.Recycle(). This will store the item within the recycle bin.