5

Option 1 How to add/upload publishing page layout via CSOM in PowerShell: [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client") [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime") Function Get-ClientContext([string]$Url,[string]$UserName,[string]$Password) { $SecurePassword = $Password | ...


4

Use GLOBAL as TemplateName. <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <FeatureSiteTemplateAssociation Id="{464b78de-c14e-4c88-bd52-00136fc899f4}" TemplateName="GLOBAL" /> </Elements> See Feature/Site Template Association


3

There is not direct way to check if site was unsuccessfully provisioned programmatically. For a workaround after successful provisioning of site or in web provisioned event , you can create a web property like "WebProvisioned" and check that property in your code. If it does not exist, delete that site and create again.


3

Up until April 2014 Cumulative Update for the SharePoint 2013 release only Office 365 and SP Online supported the provisioning of site collections remotely using CSOM extensions (part of the Windows PowerShell for SharePoint Online package). This set of functionalities was not available for on-premises (or Office365-Dedicated). With April 2014 Cumulative ...


3

I found the solution. Forgot to publish the content type and run the timer job (content type hub & subscriber). After that everything worked! I don't have to run the timerjobs in the feature (code), it works without it!


2

The Search Center is a dedicate site template, with its dedicated onet / webtemp entries & definition. You could easily add one to your site collection by creating a subsite with the template SRCHCENTERLITE#0 / SRCHCENTERLITE#1 or SRCHCEN#0. Alternatively, you could inject the key search webpart within a dedicated page like in your code sample. You'll ...


2

Timer service was stopped and in Manual. Starting the Timer Service, solved this issue.


2

We have only discussed this internally but not created an actual solution yet. Here are some of the thoughts I have on the subject: I would probably opt for a pattern with a provider hosted app that create the site collection using the correct master page etc. This means that you could host on your own IIS on-premises, and when you move it to the cloud you ...


2

Found the answer: remove the space from the group or term set name in the XML. You can leave the spaces in the metadata fields themselves.


2

You would be looking at Remote Provisioning using provider hosted app. The following steps will be covered under this approach: Override create sub site link with hook to provider hosted app (if we target sub site creation) Actual template selection is coming from provider hosted app side based on configuration – abstraction layer to provider different ...


2

I think the accepted answer you're pointing is not completely accurate. The question raised in that post is more probably "Why do all examples I see insert the fields twice?" instead of "Why do I need to insert the fields twice?". I think this is at least how the answerer understood it. The point is: you can insert them twice (i.e. redefine the fields at ...


2

This is a fairly common workflow, one I've used in multiple projects. The templates can be safely repeatedly deployed to the same site but watch for templates that do upgrades to existing sites, the templates won't remove anything so you may have to supplement your upgrade process with some PNP PowerShell if you are changing stuff (rather than adding stuff, ...


2

I would add the web part as custom using the ID, for example: Add-PnPClientSideWebPart -Page $homePage -Component "b519c4f1-5cf7-4586-a678-2f1c62cc175a" -Section 1 -Column 1 You can find the ID by adding the part to the page and inspecting the element in dev tools. Search for data-sp-feature-instance-id.


2

PnP PowerShell documentation migrated to new URL. This is new URL: PnP PowerShell documentation. You can find the cmdlets under the Cmdlets tab. Related thread: Not able to access PnP PowerShell documentation Reply from PnP PowerShell twitter account: We are working on getting the new documentation in place.


1

Yes, surprisingly few examples. If you check the code in github, then you will see that it uses SharePointConnector and passes all these parameters to that connector. First parameter is the CSOM context, second is the URL of the site which holds the templates and third is the URL of the library + folder in that site where the templates are stored. An example ...


1

You don't need to do all that work anymore. In a recent update to the SharePoint Online Management Shell, there is a commandlet to do this for you with much less effort. It is Request-SPOPersonalSite. You can enqueue up to 200 OneDrive for Business sites at a time. $emails = "user1@contoso.com,user2@contoso.com" Request-SPOPersonalSite -UserEmails $emails ...


1

For achieving your requirement You should create one list with column like title,url,template, Sub site Manager You should create web level feature which provision your "Sub Site Manager" field(Note that scope will be web, otherwise it will create site collection level column) You should bind "Item Added" event receiver column to that list and following ...


1

Try changing Type="GhostableInLibrary" to Type="Ghostable" in the elements.xml file. This fixed the issue for me. MSDN discussion related to this problem Blog post confirming the fix


1

The problem with your code is that you are generating the context for the App Web, but trying to change the master on the host web. You need to change one line on the updateMaster method to use the app host web for creating the ClientContext. This url can be read from the query string. function updateMaster() { var clientContext = SP.ClientContext(...


1

The answer to this problem is solved by retrieving the site collection administrator. private static void AddManagerToList(SPSite site, string listTitle) { try { var web = site.OpenWeb(); var list = web.Lists.TryGetList(listTitle); if (list != null) { ...


1

I am still not sure 'why' links such as lists with 'QuickLaunchOptions.On' that are created before the last web feature is activated are either not being deleted or are being added after that feature completes. This only occurs when the feature is activated during site creation. In any case the following code works to fix the problem. It causes the ...


1

Alright, here's what I ended up doing. Since I couldn't actually move the file without the references also being redirected, I had to first make sure that the original master page content was saved. I simply made a copy of the original file under a different name. Now, I still had the problem of updating my master page throughout my site collection (since ...


1

You can clone the site collection( i am sure you are going to use Backup & restore Method). What i see in terms of disadvantage, you have to perform the cleanup on the new site collection as Security / permissions Event reciever & Workflows in the list Alerts on List Search, If both sites crawled and having the same content will cause the ...


1

I think CT hub is good idea, it is central location to control the things. Here’s a little powershell to publish content types from the content type hub to subscribing sites. $HubUrl = “http://contenttypehuburl” $HubSite = Get-SPSite $HubUrl $HubWeb = $HubSite.RootWeb $Publisher = New-Object Microsoft.SharePoint.Taxonomy.ContentTypeSync....


1

Here are very good examples to add Xsltlistviewwebpart programmatically. http://www.c-sharpcorner.com/UploadFile/sagarp/programmatically-adding-xsltlistviewwebpart-inside-panel-in/ http://sharepointnadeem.blogspot.in/2012/08/programatically-add-xsltlist-view.html http://damneddutch.blogspot.in/2012/08/programmatically-create-sharepoint.html Sample code: ...


1

I tried exporting the Web Part, then importing the XML in the elements file. I tried writing JavaScript that creates and adds the Web Part to the page the first time someone landed on the page, nothing seemed to add the Web Part correctly. In the end, I put the web part on the page, using SharePoint GUI. Once the page and web part looked how I wanted it to ...


1

The state of the features is probably being cached between your two Features.Add lines. I would first move the line that adds the site collection feature so that it occurs before opening the SPWeb. Secondly, if you are still seeing issues with it being cached, open the site collection a second time to do the SPWeb feature. For instance: SPSecurity....


1

I finally figured this. (And now that I've figured it, the solution seems so obvious I wonder why I didn't figure this out before!) It so happened that the Sharepoint site we were deploying our page to had a poorly written Master.CSS file where the font 'Arial' was being applied to all <div> tags! As a result, the cell within which the Wingdings font ...


Only top voted, non community-wiki answers of a minimum length are eligible