Advertisement
Guest User

Untitled

a guest
Jul 14th, 2014
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. Add-Type -Path "c:folderMicrosoft.SharePoint.Client.dll"
  2.  
  3. Add-Type -Path "c:folderMicrosoft.SharePoint.Client.Runtime.dll"
  4.  
  5. $siteUrl = “https://mytenant.sharepoint.com/sites/mysitecollection”
  6.  
  7. $username = "admin@mytenant.onmicrosoft.com"
  8.  
  9. $password = Read-Host -Prompt "Enter password" -AsSecureString
  10.  
  11. $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
  12.  
  13. $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)
  14.  
  15. $ctx.Credentials = $credentials
  16.  
  17. $webCreationInformation = New-Object Microsoft.SharePoint.Client.WebCreationInformation
  18.  
  19. $webCreationInformation.Url = "site1"
  20.  
  21. $webCreationInformation.Title = "Site 1"
  22.  
  23. $webCreationInformation.WebTemplate = "STS#0"
  24.  
  25. $newWeb = $ctx.Web.Webs.Add($webCreationInformation)
  26.  
  27. $ctx.Load($newWeb)
  28.  
  29. $ctx.ExecuteQuery()
  30.  
  31. $newWeb
  32.  
  33. Write-Host "Title" $newWeb.Title
  34.  
  35. Connect-SPOService -Url https://contoso-admin.sharepoint.com -credential admin@contoso.com
  36.  
  37. 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