Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll" Add-Type -Path "c:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" $siteUrl = "https://tenant.sharepoint.com/sites/mysitecollection" $username = "username@tenant.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() Write-Host "Title" $newWeb.Title am i missing something? i'm global administrator for my o365 tenant & sharepoint admin in sharepoint online. still getting this error : Exception calling "ExecuteQuery" with "0" argument(s): "The remote server returned an error: (403) Forbidden."
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)