Forum Discussion
Mukund2021
Jan 21, 2022Copper Contributor
The underlying connection was closed: An unexpected error occurred on a send
PowerShell Script connecting to SharePoint online using Connect-PNPOnline as below code sample $credential = Import-Clixml $currfolderPath"\SPOnlineCredential.xml" $credentials = New-Object ...
Jan 21, 2022
If you run the command below, does it allow you to connect?
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12
(It allows TLS, TLS 1.1 and TLS 1.2)
- Mukund2021Jan 23, 2022Copper Contributor
Dear Harm_Veenstra,
Thank you for your reply, I have used all the possible Security Protocol on defining on Top of the script and also inside the function of my PowerShell script , Please find the attached screen shot for the same but still I am getting same error, Is it some thing I should upgrade PowerShellGet Module but it is also , at latest version 1.0.0.1, Please guide me for this error
Thank you so much.
With Regards
Mukund
- Jan 23, 2022Perhaps upgrading to the newer pnp.powershell module is an idea? https://www.sharepointdiary.com/2021/02/how-to-install-pnp-powershell-module-for-sharepoint-online.html Has the same commands, when running the older just now it said to uninstall the old version (uninstall-Module -Name SharePointPnPPowerShellOnline -AllVersions -Force) and use install-module pnp.powershell
- Jan 26, 2022Or did you already use pnp.powershell?