Updating sites PnP Powershell #791
-
I am trying the below to turn off the offline availability on SharePoint Online sites, ` Cls #Parameters $Cred = Get-Credential #Connect to SharePoint Online site #Getting all the site collections
I have 100,000 sites to loop through however it gets stuck nearly after running for an hour. I would appreciate any help or ideas please. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
First off, what version are you using, the old depricated SharePointPnPPowerShellOnline or PnP.PowerShell? The old one does not handle throttling, so it is a good idea to set up retry logic if you are being throttled or connections are dropped (429 and 5xx errors) Secondly, please supply full exception (write out Get-PnPException). We cannot help you if you do not supply the specific exception you are receiving. Regarding the code, you should use -ReturnConnection and assign a specific connection that you then remember to disconnect inside the loop in a Finally statement after catch:
|
Beta Was this translation helpful? Give feedback.
First off, what version are you using, the old depricated SharePointPnPPowerShellOnline or PnP.PowerShell? The old one does not handle throttling, so it is a good idea to set up retry logic if you are being throttled or connections are dropped (429 and 5xx errors)
Secondly, please supply full exception (write out Get-PnPException). We cannot help you if you do not supply the specific exception you are receiving.
Regarding the code, you should use -ReturnConnection and assign a specific connection that you then remember to disconnect inside the loop in a Finally statement after catch: