Comments (6)
Hi Roman,
Please include the code of your script straight after the New-SPOWeb cmdlet. I assume you're doing something like
$web = new-spoweb
and then you use the $web object?
Because it's using CSOM, not all properties of the web object are loaded by default ,e.g. you might have to request them specifically
for instance:
$ctx = Get-SPOContext
$list = web.Lists.GetByTitle("Test")
$ctx.Load($list)
$ctx.ExecuteQuery()
from pnp-powershell.
Hi Erwin.
Here is my code:
Connect-SPOnline -url $destinationUrl -credentials $Credential
... some other stuff...
Here is the script line throwing the Exception:
New-SPOWeb -Title $destinationSubsiteName -Url $destinationSubsiteName -Description "Some Description" -Locale 1033 -Template "STS#0"
Thanks
Roman
from pnp-powershell.
Hi Roman, I just double checked the cmdlet on my end but I experience no problems with it.
The site collection you connected to, that one still exists I assume? Do you have appropriate access rights to create subwebs? the URL is just in the shape of "mysubweb" or something alike?
Also: are you working against O365, or towards an on-prem environment? And are you using the corresponding version of the cmdlets? e.g. the V15 version for on-prem and the V16 version for O365.
from pnp-powershell.
Could you upload the bits in the Some other stuff as it its likely in there that the error is actually occurring due to the way requests are batched together in CSOM
from pnp-powershell.
Hi Here is the whole thing - I checked all my variables but they are in the correct format - maybe someone can help:
InstallationPrerequisites.ps1
Creates Security Groups and subweb
. .\Variables.ps1
Connect-SPOnline -url $destinationUrl -credentials $Credential
Set paranmeters of the current Web
Set-SPOWeb -Title "Title"; #ToDo Alternate css URL
$CL = Get-SPOGroup -Identity 'Group1'
if($CL -eq $null)
{
New-SPOGroup -Title 'Group1' -Owner $login
}
add role
Set-SPOGroup -Identity "Group1" -AddRole 'Read';
$CL = Get-SPOGroup -Identity 'Group2'
if($CL -eq $null)
{
New-SPOGroup -Title 'Group2' -Owner $login
}
add role
Set-SPOGroup -Identity "Group2" -AddRole 'Contribute'
$CL = Get-SPOGroup -Identity 'Group3'
if($CL -eq $null)
{
New-SPOGroup -Title 'Group3' -Owner $login
}
add role
Set-SPOGroup -Identity "Group3" -AddRole 'Contribute'
Subweb exists?
$SW = Get-SPOSubWebs -Identity 'MySubWeb'
if($SW -eq $null)
{
# add NAvigation node to current web !!!!! This will throw an error: #58
New-SPOWeb -Title $destinationSubsiteName -Url $destinationSubsiteName -Description "HR Workflows fΓΌr die Migros Klubschule" -Locale 1033 -Template "STS#0"
Add-SPONavigationNode -Location "QuickLaunch" -Title "MyNav" -Url $destinationSubUrl
}
from pnp-powershell.
We're currently many versions of the cmdlets newer. I will for now close this issue but if you feel this issue is still relevant, please do not hesitate to reopen this issue.
from pnp-powershell.
Related Issues (20)
- [BUG] Set-PnPGroup -SetAssociatedGroup Owners: Access denied.
- Example 1 incorrect on Clear-PnPRecycleBinItem Microsoft Docs page HOT 1
- Get-PnPTerm unable to retrieve labels HOT 2
- [BUG]
- [BUG] Term Store PnP functions fail when using Connect-PnPOnline -SPOManagementShell HOT 7
- [BUG]? - Grant-PnPTenantServicePrincipalPermission timing out HOT 2
- [BUG] false error reported from Add-PnPFolder on large Library
- Connect-PnPOnline- with an option of -ClientId and -ClientSecreat connects successfully but then get unauthorized(401)) for subsequent request example Get-PNPList etc.
- Critical problem with Apply-PnPProvisioningTemplate cmdlet: personal view is created as public view in the destination site
- [BUG] - Move-PnPFolder : The underlying connection was closed: A connection that was expected to be kept alive was closed by the server.
- [BUG] Get-PnPSite -Includes Usage Shows Zero for Bandwidth, Hits, Visits
- [BUG] "The user cannot create group sites in this tenant instance." HOT 3
- [BUG] ConvertTo-PnPClientSidePage fails at OfficeDevPnP.Core.Pages.ClientSidePage.AvailableClientSideComponents(String name) - A critical error occurred - transformation did not complete
- [BUG] Get-PnPTerm throws misleading error if term not found
- [BUG] Add-PnPWebhookSubscription. Body empty.
- [BUG]
- Get-PnPFolder : A parameter cannot be found that matches parameter name 'List'[BUG]
- [BUG] Search bar for List gets enabled while trying to hide suitebar search using "Set-PnPSearchSettings -SearchBoxInNavBar Hidden -Scope Web". Is there any way to hide search bar for list too.
- [BUG] GCC High client tokens Confidential Client is not supported in Cross Cloud request
- Set-PnPSite command reporting (401) Unauthorized Error, in environment where legacy authentication is blocked HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pnp-powershell.