Office 365: Creating Site Scripts and Site Designs from existing lists (I)!

Create a Site Script from an existing SharePoint Online (SPO) list/document library is a very easy task that can be done by means of PowerShell. Once the Site Script is created, we can create a new Site Design so we can add the list/document library to any SPO site:

$sUserName="<UserName>@<O365Domain>.onmicrosoft.com"
$sMessage="Type your Office 365 Credentials"
$SPOAdminCenterUrl="https://<O365Domain>-admin.sharepoint.com/"
$O365Credentials=Get-Credential -UserName $sUserName -Message $sMessage
Connect-SPOService -Url $SPOAdminCenterUrl -Credential $O365Credentials

$sSPOListUrl="https://<SPOListURL>"
$sSPOSiteScriptFromList = Get-SPOSiteScriptFromList -ListUrl $sSPOListUrl
$sSPOListName="<Site Script Name>"
$sSPOListDescription="<Site Script Description>"
Add-SPOSiteScript -Title $sSPOListName -Description $sSPOListDescription -Content $sSPOSiteScriptFromList

-- Create Site Design
$sSiteDesignTitle="<Site Design Title>"
$sWebTemplate="68"
$sSiteScriptID="<Site Script ID>"
$sSiteDesignDescription="<Site Design Description>"
Add-SPOSiteDesign -Title $sSiteDesignTitle -WebTemplate $sWebTemplate -SiteScripts $sSiteScriptID -Description $sSiteDesignDescription

Disconnect-SPOService

Note that the previous script requires to get first the Site Script ID in order to be able to create the Site Design. If everything goes well, the new Site Design will be available to be used in any site:

image

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión /  Cambiar )

Google photo

Estás comentando usando tu cuenta de Google. Cerrar sesión /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión /  Cambiar )

Conectando a %s