Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Add-Type -Path "c:folderMicrosoft.SharePoint.Client.dll"
- Add-Type -Path "c:folderMicrosoft.SharePoint.Client.Runtime.dll"
- $siteUrl = “https://mytenant.sharepoint.com/sites/mysitecollection”
- $username = "admin@mytenant.onmicrosoft.com"
- $password = Read-Host -Prompt "Enter password" -AsSecureString
- $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
- $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
- $ctx.Credentials = $credentials
- $webCreationInformation = New-Object Microsoft.SharePoint.Client.WebCreationInformation
- $webCreationInformation.Url = "site1"
- $webCreationInformation.Title = "Site 1"
- $webCreationInformation.WebTemplate = "STS#0"
- $newWeb = $ctx.Web.Webs.Add($webCreationInformation)
- $ctx.Load($newWeb)
- $ctx.ExecuteQuery()
- $newWeb
- Write-Host "Title" $newWeb.Title
- Connect-SPOService -Url https://contoso-admin.sharepoint.com -credential admin@contoso.com
- New-SPOSite [-Url] <UrlCmdletPipeBind> -Owner <String> -StorageQuota <Int64> [-CompatibilityLevel <Int32>] [-LocaleId <UInt32>] [-NoWait <SwitchParameter>] [-ResourceQuota <Double>] [-Template <String>] [-TimeZoneId <Int32>] [-Title <String>]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement