SPOSiteDesign¶
Parameters¶
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
| Title | Key | String | The title of the site design. | |
| SiteScriptNames | Write | String[] | The names of the site design scripts. | |
| WebTemplate | Write | String | Web template to which the site design is applied to when invoked. | CommunicationSite, TeamSite, GrouplessTeamSite |
| Description | Write | String | Description of site design. | |
| IsDefault | Write | Boolean | Is site design applied by default to web templates. | |
| PreviewImageAltText | Write | String | Site design alternate preview image text. | |
| PreviewImageUrl | Write | String | Site design preview image url. | |
| Version | Write | UInt32 | Site design version number. | |
| Ensure | Write | String | Used to add or remove site design. | Present, Absent |
| Credential | Write | PSCredential | Credentials of the Office365 Tenant Admin. | |
| ApplicationId | Write | String | Id of the Azure Active Directory application to authenticate with. | |
| ApplicationSecret | Write | PSCredential | Secret of the Azure Active Directory application to authenticate with. | |
| TenantId | Write | String | Name of the Azure Active Directory tenant used for authentication. Format contoso.onmicrosoft.com | |
| CertificateThumbprint | Write | String | Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication. | |
| CertificatePassword | Write | PSCredential | Username can be made up to anything but password will be used for CertificatePassword | |
| CertificatePath | Write | String | Path to certificate used in service principal usually a PFX file. | |
| ManagedIdentity | Write | Boolean | Managed ID being used for authentication. | |
| AccessTokens | Write | String[] | Access token used for authentication. |
Description¶
This resource configures Site Designs.
Permissions¶
Graph¶
To authenticate with the Graph API, this resource requires the following permissions:
Delegated permissions¶
- Read
-
Domain.Read.All
-
Update
- Domain.Read.All
Application permissions¶
- Read
-
Domain.Read.All
-
Update
- Domain.Read.All
Sharepoint¶
To authenticate with the Sharepoint API, this resource requires the following permissions:
Delegated permissions¶
- Read
-
Sites.FullControl.All
-
Update
- Sites.FullControl.All
Application permissions¶
- Read
-
Sites.FullControl.All
-
Update
- Sites.FullControl.All
Examples¶
Example 1¶
This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.
Configuration Example
{
param
(
[Parameter()]
[System.String]
$ApplicationId,
[Parameter()]
[System.String]
$TenantId,
[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC
Node localhost
{
SPOSiteScript 'SPOSiteScript-SiteDesign'
{
Title = "Contoso Team Site Lists"
Content = '{"$schema": "https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json", "actions": [{"verb": "createSPList", "listName": "Customer Tracking", "templateType": 100}], "version": 1}'
Description = "Creates the customer tracking list on new team sites"
Ensure = "Present"
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
}
SPOSiteDesign 'SPOSiteDesign-Example'
{
Title = "Contoso Team Site Design"
SiteScriptNames = @("Contoso Team Site Lists")
WebTemplate = "TeamSite"
IsDefault = $false
Description = "Standard layout for departmental team sites"
PreviewImageAltText = "Contoso team site layout"
PreviewImageUrl = "https://contoso.sharepoint.com/SiteAssets/team-site-preview.png"
Version = 1
DependsOn = "[SPOSiteScript]SPOSiteScript-SiteDesign"
Ensure = "Present"
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
}
}
}
Example 2¶
This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.
Configuration Example
{
param
(
[Parameter()]
[System.String]
$ApplicationId,
[Parameter()]
[System.String]
$TenantId,
[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC
Node localhost
{
SPOSiteScript 'SPOSiteScript-SiteDesign'
{
Title = "Contoso Team Site Lists"
Content = '{"$schema": "https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json", "actions": [{"verb": "createSPList", "listName": "Customer Tracking", "templateType": 100}], "version": 1}'
Description = "Creates the customer tracking list on new team sites"
Ensure = "Present"
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
}
SPOSiteDesign 'SPOSiteDesign-Example'
{
Title = "Contoso Team Site Design"
SiteScriptNames = @("Contoso Team Site Lists")
WebTemplate = "TeamSite"
IsDefault = $false
Description = "Standard layout for departmental and project team sites" # Updated Property
PreviewImageAltText = "Contoso team site layout"
PreviewImageUrl = "https://contoso.sharepoint.com/SiteAssets/team-site-preview.png"
Version = 1
DependsOn = "[SPOSiteScript]SPOSiteScript-SiteDesign"
Ensure = "Present"
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
}
}
}
Example 3¶
This example is used to test new resources and showcase the usage of new resources being worked on. It is not meant to use as a production baseline.
Configuration Example
{
param
(
[Parameter()]
[System.String]
$ApplicationId,
[Parameter()]
[System.String]
$TenantId,
[Parameter()]
[System.String]
$CertificateThumbprint
)
Import-DscResource -ModuleName Microsoft365DSC
Node localhost
{
SPOSiteDesign 'SPOSiteDesign-Example'
{
Title = "Contoso Team Site Design"
Ensure = "Absent"
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
}
SPOSiteScript 'SPOSiteScript-SiteDesign'
{
Title = "Contoso Team Site Lists"
Ensure = "Absent"
ApplicationId = $ApplicationId
TenantId = $TenantId
CertificateThumbprint = $CertificateThumbprint
}
}
}