Created
January 23, 2019 14:57
-
-
Save garrytrinder/6bb97a8298ab9163861b4b4b32295beb to your computer and use it in GitHub Desktop.
Azure Automation Runbook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$CredentialName, | |
[Parameter(Mandatory=$true)] | |
[string]$TenantAdminUrl, | |
[Parameter(Mandatory=$true)] | |
[string]$SiteTitle, | |
[Parameter(Mandatory=$true)] | |
[string]$SiteDescription, | |
[Parameter(Mandatory=$true)] | |
[string]$SiteUrl, | |
[Parameter(Mandatory=$true)] | |
[string]$SiteOwner, | |
[Parameter(Mandatory=$true)] | |
[int]$Lcid, | |
[Parameter(Mandatory=$true)] | |
[string]$TemplateId, | |
[Parameter(Mandatory=$true)] | |
[int]$TimeZoneId | |
) | |
$ErrorActionPreference = "Stop" | |
# create connection to SharePoint Admin site | |
$ConnectAdmin = Connect-PnPOnline -Url $TenantAdminUrl -Credentials (Get-AutomationPSCredential -Name $CredentialName) | |
# create Modern site with no Office 365 group | |
$NewSite = New-PnPTenantSite -Title $SiteTitle -Description $SiteDescription -Url $SiteUrl -Owner $SiteOwner -Lcid $Lcid -Template $TemplateId -TimeZone $TimeZoneId -Wait | |
# clean up SharePoint Admin connection | |
$DisconnectAdmin = Disconnect-PnPOnline |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment