Is it possible to create site collection after creating new content database in Sharepoint 2019 CSOM (C#)?

I’m working on SharePoint 2019 environment.

I have just created site collection programmatically (CSOM) using MSDN Link

However, I want to create a content database through CSOM and point this newly created Content DB for creating above new site collection.

Any help is much appreciated!

Move Content Type from one Site Collection to another Site Collection

I have a custom content type “Employee” that inherits from the “Document Set” content type. It has metadata attached to it as well and it resides in a document library.

I would like to create a script to move the “Employee” content type from Document Library A in Site Collection A to Document Library B in Site Collection B.

I would like for all the metadata to stay in tact as well as all the folders and files that live under the Document Set.

Is this possible in SharePoint Online?

PowerApps Gallery Items not visible when collection as a source

I’m using PowerApps to create an application. For creating menu items, I’ve added a collection on the OnVisible event of the home screen. Below is the function snippet for your reference.

Clear(MenuItems); Collect(MenuItems, {   Name: "Home",   Screen:HomeScreen,   Image: home,   SelectedIcon: home_enabled   }, {   Name: "Settings",   Screen:Settings,   Image:  settings,   SelectedIcon: settings_enabled }); 

After adding a collection, I’ve added the gallery component from the Studio itself for the navigation and set its source to our MenuItems collection that I’ve created earlier.

Even after connecting to the correct collection, I’m not able to view those collections items in the gallery.

What could be the possible reasons?

Move file to another site collection

I have following code:

var sourceSite = ""; var targetSIte = "";  var ctx = ClientContextExtension.GetAppContext(sourceSite, _config.AppRegistrationId, _config.AppRegistrationKey, "SaveToExcel", new EmptyLogger()); Microsoft.SharePoint.Client.List list = ctx.Web.GetDocumentsList();  var item = list.GetItemById(1);  ctx.Load(item);  ctx.ExecuteQuery();   if (item.FileSystemObjectType == FileSystemObjectType.File)  {      var file = item.File;      ctx.Load(file);      ctx.ExecuteQuery();      var r = new ResourcePath();       file.MoveTo("/sites/afd-286-oprydning-test-target/TestDoc/Test01.docx", Movperations.Overwrite);      ctx.ExecuteQuery();  } 

I get following error:

Microsoft.SharePoint.Client.ServerException: ‘Server relative urls must start with SPWeb.ServerRelativeUrl’

Any pointers how to move a file? I also tried a fully qualified url but no luck.

According to documentation:

You should use MoveToByPath but I havent found a single hit on a sample on google.

Create new site collection in existing web application with different existing content DB

I have a SharePoint 2010 root level site collection SC1 in web application WEBAPP1. I want to create copy of that site collection in same web application WEBAPP1. Apart from Import/Export, Restore/Backup options, will following approach work? If yes , how?

  • I took backup of content database of web application.
  • Restored database with different name
  • Mounted Content database to this WEBAPP1 by assigning new ID to DB
  • Created new site collection by using this newly mounted DB

Site collection gets created successfully but content does not appear.

Please guide if i can achieve desired functionality by using this approach.

Query site collection property bag in SPFx extension

I am building an SPFx Application Customizer for a Powell365 project, and trying to have it use custom properties from the current site collections’s property bag.

I already managed to get these properties in SP Powershell, using the code linked below. How can I access those values in my SPFx Applicaton Customizer, and what are the modules I need to import?

The code from only throws a Type error,

“Object does not support the property or method “from”.

Any support will be appreciated! Please let me know if I can supply more information. “Get complex properties”:

import { sp } from "@pnp/sp";"AllProperties").expand("AllProperties").get().then(success=>{[...]},error=> {[...]}) 

Powershell Script:

Can’t create Variation label for SharePoint site collection

Good day,

I have some problem with creating multi-language SharePoint site. I have site collection with “SharePoint Server Publishing Infrastructure enabled”. I follow this article here.

Following the article (Create the source variation site) I go to Site Collection Administration, click Variation labels. On the Variations Label page, I click New Label. I try to select Location field Value.

In the article was written “It they will be at the top level of the site collection, just type a forward slash (/)”

I type “/” in the Location field and get the error “The root site of the options should be the publication site”. I can’t understand, what is wrong if “SharePoint Server Publishing Infrastructure” option is enabled. “SharePoint Server Publishing” is enabled too.

Thank you in advance.