Hi,
I' d like to run the following command in a scheduled task,
Program: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Argument: -command "& Send-MailMessage -To recipient@server.com -From monitoring@server.com -SmtpServer mail.server.com -Subject "Service status on $env:ComputerName" -body "$((gsv -Name Print*) | out-string)" -Encoding ([System.Text.Encoding]::UTF8)"
The script works inside a shell but it doesn't work in a scheduled task, so how should I change it to run in the scheduled task?
Cheers