Found Here: .net - Authentication failed because remote party has closed the transport stream - Stack Overflow
I came across this issue when trying to send an e-mail to O365 via .NET C# code.
My Option is add the following Registry key:
Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319
Value: SchUseStrongCrypto
It is worth noting that .NET 4.6 will use the correct protocol by default and does not require either solution.
ad47d08d-3a4e-46eb-b03b-74652e411469|0|.0
From here: https://superuser.com/questions/579900/why-cant-excel-open-a-file-when-run-from-task-scheduler
1. Open Component Services (Start -> Run, type in dcomcnfg)
2. Drill down to Component Services -> Computers -> My Computer and click on DCOM Config
3. Right-click on Microsoft Excel Application and choose Properties
4. In the Identity tab select This User and enter the ID and password of an interactive user account (domain or local) and click Ok
Keeping it as the interactive user or the launching doesn't work with the task scheduler unfortunately, even when setting the task up to run under an account that has admin access to the machine.
4a55fc18-c1aa-41f2-a3e9-d8c0e37c1676|0|.0
1. Access your OneDrive. Log in using your Microsoft credentials.
2. Select any files and/or folders that you wish to share.
3. Click on the “Share” button, located in the upper left corner of the screen.
4. Once the “Share” dialog box opens, select the “Set password” option.
5. Input the password you wish to add to the link.
6. Select the “Get a link” option.
7. The link that pops up now can be copied, and if shared it will ask for a password before its contents can be interacted with.
08f8a217-abfa-49e2-aff7-c7c50cdf17b5|0|.0