-
Notifications
You must be signed in to change notification settings - Fork 105
SPWeb
Yorick Kuijs edited this page Nov 8, 2018
·
19 revisions
| Parameter | Attribute | DataType | Description | Allowed Values |
|---|---|---|---|---|
| Url | Key | string | The URL of the web | |
| Ensure | Write | string | Present if the web should exist or Absent if it should be removed | Present, Absent |
| Description | Write | string | The description to apply to the web | |
| Name | Write | string | The Name of the web | |
| Language | Write | uint32 | The Lanhuage (LCID) of the web | |
| Template | Write | string | The WebTemplate to use to create the web | |
| UniquePermissions | Write | Boolean | True if the web should have unique permissions, otherwise false. | |
| UseParentTopNav | Write | Boolean | True if the web should use the parent nav bar, otherwise false. | |
| AddToQuickLaunch | Write | Boolean | True if the web should be in the quick launch of the parent web, otherwise false. | |
| AddToTopNav | Write | Boolean | True if the web should be added to the top nav bar of the parent web, otherwise false. | |
| RequestAccessEmail | Write | string | The e-mail address to which requests for access are sent. Set to emtpy string to disable access requests. | |
| InstallAccount | Write | PSCredential | POWERSHELL 4 ONLY: The account to run this resource as, use PsDscRunAsCredential if using PowerShell 5 |
Type: Distributed Requires CredSSP: No
This resource will provision a SPWeb based on the settings that are passed through. These settings map to the New-SPWeb cmdlet and accept the same values
The default value for the Ensure parameter is Present. When not specifying this parameter, the web is created.
This example deploys a subsite in a specific location
Configuration Example
{
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost {
SPWeb TeamSite
{
Url = "http://sharepoint.contoso.com/sites/site/subweb"
Name = "Team Sites"
Ensure = "Present"
Description = "A place to share documents with your team."
Template = "STS#0"
Language = 1033
AddToTopNav = $true
PsDscRunAsCredential = $SetupAccount
}
}
}This example deploys a subsite in a specific location and enables access requests for this web
Configuration Example
{
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost {
SPWeb TeamSite
{
Url = "http://sharepoint.contoso.com/sites/site/subweb"
Name = "Team Sites"
Ensure = "Present"
Description = "A place to share documents with your team."
Template = "STS#0"
Language = 1033
AddToTopNav = $true
UniquePermissions = $true
RequestAccessEmail = "sample@contoso.com"
PsDscRunAsCredential = $SetupAccount
}
}
}This example deploys a subsite in a specific location and disables access requests for this web
Configuration Example
{
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupAccount
)
Import-DscResource -ModuleName SharePointDsc
node localhost {
SPWeb TeamSite
{
Url = "http://sharepoint.contoso.com/sites/site/subweb"
Name = "Team Sites"
Ensure = "Present"
Description = "A place to share documents with your team."
Template = "STS#0"
Language = 1033
AddToTopNav = $true
RequestAccessEmail = ""
PsDscRunAsCredential = $SetupAccount
}
}
}
- Home
- Getting Started
- Pre-requisites
- Installing the module
- Exporting SharePoint Configuration
- Creating Configuration Files
- Pre-created Examples
- Creating an Azure development environment
- Understanding Resources & Syntax
- Remote PowerShell Authentication
- Contributing to SharePointDsc
- Other useful modules for SharePoint DSC configurations