TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Get All Master Pages Applied to All sites in a SharePoint 2013
Lakshmanan Sethu Sankaranarayan
Oct 17
2014
Code
4.2
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
Below are the Powershell commands to get Master Pages applied to all the sites and sub site in a SharePoint Site Collection 2013.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Get All site collections
$SiteCollections = Get-SPWebApplication | Get-SPSite -Limit All
#Loop through all site collections
foreach
($Site
in
$SiteCollections)
{
#Loop throuh all Sub Sites
foreach
($Web
in
$Site.AllWebs)
{
$MasterPage = $Web.GetFile($Web.MasterUrl);
$MasterPage.Name +
" : "
+$Web.Url
}
}
Master Pages
SharePoint 2013
Powershell