[BUG] #3686
Unanswered
thejoarjun
asked this question in
General
[BUG]
#3686
Replies: 1 comment
-
@gautamdsheth I see this issue is converted to a discussion. Any reason or update on this |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Reporting an Issue
I am in the process of running some test for checking permissions on SharePoint online sites.
These are automation scripts that run without any user interaction.
The script connects to 10000+ sites via pnp powershell to generate reports using client id and secret.
The App has required permissions. However, some Connect-PnPOnline commands fails. Not the same sites always.
Connect-PnPOnline -Url $url -ClientId $clientID -ClientSecret $clientSecret
Connect-PnPOnline : An error occurred while sending the request.
Expected behavior
Expected behavior is for it to connect to the site using PnP online .
Actual behavior
Code will sometimes connect to PnPOnline fine.
After a couple of runs it begins to fail.
Steps to reproduce behavior
Connect-PnPOnline -Url $Adminsiteurl -ClientId $clientID -ClientSecret $clientSecret
$SitesCollections = Get-PnPTenantSite | Where -Property Template -NotIn ("SRCHCEN#0", "SPSMSITEHOST#0", "APPCATALOG#0", "POINTPUBLISHINGHUB#0", "EDISC#0", "STS#-1", "POINTPUBLISHINGPERSONAL#0")
For ($num=1; $num -le $SitesCollections.Count; $num++) {
try {
$siteurl = $SitesCollections[$num].url;
Start-Sleep -Seconds 0.5;
#Sp App Auth
Connect-PnPOnline -Url $siteurl -ClientId $clientID -ClientSecret $clientSecret
}
}
catch
{ Write-Host $_ }
What is the version of the Cmdlet module you are running?
Directory: C:\Program Files\WindowsPowerShell\Modules
ModuleType Version Name ExportedCommands
Manifest 1.12.0 PnP.PowerShell {Add-PnPAdaptiveScopeProperty, Add-PnPPropertyBagValue, Add-PnPSiteClassification, Copy-PnPFolder...}
Which operating system/environment are you running PnP PowerShell on?
Beta Was this translation helpful? Give feedback.
All reactions