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 23, 2022
Perhaps 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, 2022
Or did you already use pnp.powershell?
- Mukund2021Jan 28, 2022Copper Contributor
Yes, I used SharePointPnPPowerShellOnline 3.13.1909.0 in my script .
The same copy of PowerShell script is executing successfully and connection to SharePoint. online website without any issue on other SharePoint farm servers, but one SP2013 farm UAT and PRD servers are giving the issue of TLS 1.2 unsupported protocols, I have attached the screen shot as well , this online SharePoint.com I am trying to connect with my PowerShell script into the Connection function but it gives error of The underlying connection was closed:
I am not sure If there is any thing I should work be upgrading the script as its is running ok on another SP2016 farm servers UAT and PRD. Please let me know your suggestions and comments.