Forum Discussion
dmarquesgn
Mar 17, 2022Iron Contributor
Weird problem running simple script between Powershell ISE and Powershell
Hi, I'm new to powershell and I've been developing some simple scripts to check stuff in our internal network. Now I want to set a task to run a script every morning at 9am. So I got the script r...
- Mar 21, 2022
dmarquesgn You can use this at the start of the script to set TLS to 1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
dmarquesgn
Mar 21, 2022Iron Contributor
Hi,
Thanks. I didn't knew the start-transcript command. Now I've added that into my real powershell script (not this test script), and I've got the following error on the log file.
"PS>TerminatingError(Send-MailMessage): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Unable to read data from the transport connection: net_io_connectionclosed."
Error: Could not send email to Email address removed via smtp.office365.com"
I've searched for this error and it's related to TLS. But can't find a solution to overcome it. Do you have any idea on how to fix this issue?
Thanks
Thanks. I didn't knew the start-transcript command. Now I've added that into my real powershell script (not this test script), and I've got the following error on the log file.
"PS>TerminatingError(Send-MailMessage): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Unable to read data from the transport connection: net_io_connectionclosed."
Error: Could not send email to Email address removed via smtp.office365.com"
I've searched for this error and it's related to TLS. But can't find a solution to overcome it. Do you have any idea on how to fix this issue?
Thanks
Mar 21, 2022
dmarquesgn You can use this at the start of the script to set TLS to 1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
- dmarquesgnMar 21, 2022Iron ContributorCool, now it works just as supposed.
Thanks for the guidance.- Mar 21, 2022No problem, glad it works now!