Setting the custom master page through powershell is NOT working

Advertisement

Hi,
 I am writing the below code to set the  custom master page through powershell.
But its not working .when i went to site settings-->master page --> in the drodown , the  maste page set is seattle.master ONLY, though my current master page is available in the dropdown.
 Can anyone pls help, whether i am missing in the below :
      Add-PSSnapin Microsoft.SharePoint.Powershell
       $SiteURL = "http://srvr1:22307/sites/SPW5"
    $weburl= $SiteURL
    $Site= Get-SPSite $SiteURL
    $web =  $Site.OpenWeb()
$web.CustomMasterUrl = "/_catalogs/masterpage/myMasterpage.master"
$web.MasterUrl = "/_catalogs/masterpage/myMasterpage.master"
$web.Update()
Das

Advertisement

Hi,
Is it a publishing page? If yes can you try the PowerShell scripts corresponding to the following code snippet?
var publishingWeb = PublishingWeb.GetPublishingWeb(web);
publishingWeb.CustomMasterUrl.SetInherit(inheritFromParent, false);
publishingWeb.CustomMasterUrl.SetValue(masterPageUrl, false);
publishingWeb.MasterUrl.SetInherit(inheritFromParent, false);
publishingWeb.MasterUrl.SetValue(masterPageUrl, false);
I've noticed sometime (not sure though) that Master page doesn't get updated if the inherit property is not updated first.
Thanks,
Sohel Rana
http://ranaictiu-technicalblog.blogspot.com

October 11, 2015

Setting the custom master page through powershell is NOT working

Hi,  I am writing the below code to set the  custom master page through powershell. But its not working .when i went to site settings-->master page --> in the drodown , the  maste page set is seattle.master ONLY, though my current master page is ava

Setting the: signed.applets.codebase_principal_support to true is not working ( keeps asking to set it to true)

i've Set the Boolean string to true but when i try to copy paste in firefox it just gives me the message again ( you need to set the signed.applets.codebase_principal_support to true ) Is this a know bug ? thanks.Try this extension - Allow Clipboard

What to do if my master page is too small for custom master page column, I need to change the papers

What to do if my master page is too small for custom master page column, I need to change the papersize from A4 to US letter size *My 2nd gen works fine with WPA2 and AES encryption. You may need to go back and start over.  Reset the router back to f

Custom Master page

  how to apply  custom master page site setting page in sharepoint2007 it's passible or not.Hello, Since layout page inherited from application.master page so your custom master page won't apply to settings page. You can use HHTPmodule to overwrite t

Background image of custom master page just shows for 1 second.

Hi,  I have created a custom master page from a html code and I have applied to it on my site collection, but when I open it on the web browser the background image just show up for a second or less and then the background turns white. I'll aprecciat

Sharepoint 2013 - Error while applying custom master page.

I am getting following error on my sharepoint 2013 site on applying a custom master page. System.ArgumentNullException: Value cannot be null.  Parameter name: ribbon    at Microsoft.SharePoint.WebControls.RibbonTrimmer..ctor(SPRibbon ribbon)     at M

Custom master page branding is missing buttons to add Web Parts

I've created a custom master page which does not display the "add" or "cancel" buttons when adding web parts to the page. These elements are controlled by CSS tags such as: .ms-wpadder, .ms-wpadder-cell, .ms-wpadder-buttonArea, .ms-wpa

Right master page oversets to the left master page

Hi all, I am currently working on a book. But I ran into an problem that I am not able to fix. So I was hoping you guys could  help me out with this. So this is the situation: I have an "A-Master" page. On this master page I gave the right page

Report Viewer Webpart is Blank in Custom Master Page

Dear Experts , Recently my team created a new master page to replace seattle default page in Sharepoint 2013. Things were fine till the moment we accessed one of site page containing a Report Viewer Web Part to load SSRS rdl. The web part is blank wi

How to find the Acoount Group used while creating the customer master data.

Hi, I am in xd03 mode displaying the customer master data. I want to know the ACCOUNT GROUP which was used while create this customer. How can i find it? Can any one tell me the process to find the account group? Thanks in advance.Enter the customer

Deleting Partners on the Customer Master.

Does SAP handle removing the Partner from Open Sales Orders when a Partner is deleted in the Customer Master.  For us, this is not happening, this there some config that must be turned on for this to happen ?  Or do we have place in code in a User Ex

Custom program to download texts from the Customer master

Hi team, I want to create a Functional specification for downloading texts from the Customer master. Means we are trying to come up with a Zprogram development so that this program can be used later to download texts from the customer master. Can any

I am unable to upload the customer master data using BAPI.?

Hi Guru's, i am unable to upload the customer master data using BAPI.(BAPI_CUSTOMER_CREATEFROMDATA1) Please guide me how upload the data... Thanks in iadvance Srinivas...Hello Srinivas This BAPI does not allow to create a new customer from scratch bu

Authorization to particular tabs in the Customer Master

Hi All, I have a requirement where in for the Transaction VA02 some Users should have access to particular tabs like Unloading Points & Contact Persons, but not for other tabs in the General Data tab in the Customer Master Record. Can you please sugg

How  can I get the employee code in the customer master

Hi What are the settings that I do so that I can get the employee code in the customer master? We want to create a sales order on a employee , we have HR and SD in the same box. regards PravinHi I tried xd02 it asks me for the customer , ifi click th

Workflow  keying off changes in the customer master

I have created a workflow that triggers  off of changes to a particular field in the customer master. Everything works great.. However, users are requesting to see the old value as well as the newly changed value. The event container doesn't seem to

The email id on my icloud is not working . i donot have acess to this as well. so i am unable to download apps. i cannot even set up new email id as it asks for previous password. is there any otherway i can download apps to my phones

the email id on my icloud is not working . i donot have acess to this as well. so i am unable to download apps. i cannot even set up new email id as it asks for previous password. is there any otherway i can download apps to my phonesYou need to ask

HT204053 I have different icloud and iTunes id's and I want to do homesharing for all my devices. I'm trying to set up a new iMac but homesharing is not working. SHould it be the itunes or iCloud id?

I have different icloud and iTunes id's and I want to do homesharing for all my devices. I'm trying to set up a new iMac but homesharing is not working. Should it be the itunes or iCloud id?Welcome to the Apple Community. Preferably your iTunes accou

In Camera raw setting of CS6, using the adjustment brush, the new, add or erase buttons do not work. Please advise.

In Camera raw setting of CS6, using the adjustment brush, the new, add or erase buttons do not work. Please advise.What operating system are you using? Which version of camera raw do you have in photoshop cs6? After you select the Adjustment Brush, t

Cisco Call Manager Administration Page Drop down menu not working

I'm running the mobile app browser on my Xoom tablet and when I log into Cisco Call Manager Administration page I get the menu's but it will not pull down the options. The same issue happens in google chrome. I use your browser on my desktop and have