Replies: 2 comments
-
Just bumping this. Any suggestions? Thanks in advance |
Beta Was this translation helpful? Give feedback.
-
Has anyone found the root cause of this? I encounter this issue recently with the same command, just connected to the Site rather than to the Admin Url.
I checked the site and didn't have blocked access, neither read-only mode. I left it there for few days until I had the chance to review more in details. By the time I came back to investigate further, issue was gone and I could use the command without issue. Using version 1.12.0. I know it's not supported, but I haven't seen the command having radical changes on adding owners to the site. I came across couple this, which points out to the SQL DB. So I'm not sure if it was a temporal issue on server side or what else could be. |
Beta Was this translation helpful? Give feedback.
-
Team.
I seem to be having an issue with Set-PnPTenantSite command. When it runs it could find say 100 OneDrive sites. As it starts to process i see the error message below.
Although it processes other OneDrive folders without issue. Any ideas what is going on here as its creating noise in my logs
Set-PnPTenantSite : Additions to this Web site have been blocked.
Please contact the administrator to resolve this problem.
`$AzureLocation = "123"
#Date
$DateYear = $ ((Get-Date).ToString('yyyy'))
$DateMonth = $ ((Get-Date).ToString('MMM'))
$DateDay = $ ((Get-Date).ToString('dd'))
$Time = Get-Date -Format "HH-mm"
#Create Log Folder structure based on Date
New-Item -ItemType Directory -Path "PATH-HERE$DateYear$DateMonth$DateDay\Logs" -Force
$logfile = "PATH-HERE$DateYear$DateMonth$DateDay\Logs$AzureLocation-OneDrive-Permissions-$Time.txt"
Start-Transcript -Path $logfile -Append
$ADGroupID01="GUID-HERE""
$LoginName01 = "c:0t
.c
|tenant`|$ADGroupID01"$ADGroupID02="GUID-HERE"
$LoginName02 = "c:0t
.c
|tenant`|$ADGroupID02"#===================================================================
#Azure Location
switch ($AzureLocation) {
'TEST' { $SPURL = 'https://domain-name-here-admin.sharepoint.com' }
default { $SPURL = "https://domain-name-here$AzureLocation-admin.sharepoint.com"}
}
#Share Point Connection Properties
$CxParams = @{
URL = $SPURL
ClientID = "GUID=HERE"
Tenant = "domain-name.onmicrosoft.com"
Thumbprint = "GUID-HERE"
}
#Connect to SharePoint Online
Connect-PnPOnline @CxParams
#Get all OneDrive for Business Site collections
$OneDriveSites = Get-PnPTenantSite -IncludeOneDriveSites -Filter "Url -like '-my.sharepoint.com/personal/'"
Write-Output "Total Number of OneDrive Sites Found: "$OneDriveSites.count
#Add Site Collection Admin to each OneDrive
foreach($Site in $OneDriveSites)
{
Write-host "Adding Site Collection Admin to: "$Site.URL
#Enable
Set-PnPTenantSite -Identity $site.url -Owners @($LoginName01, $LoginName02)
}
Write-host "Site Collection Admin Added to All OneDrive Sites Successfully!"
Stop-Transcript`
Beta Was this translation helpful? Give feedback.
All reactions