Friday, April 30, 2010

How to send the Windows PowerShell Output as E-Mail

Sending the information from a script to an E-mail recipient is a common request. Earlier time, it was required to write a complicated function and hope that all of the details were put together correctly in order to enable this functionality to work properly. Moreover, before spammers caused security concerns about sending E-mail from scripts, it was easier to do. Therefore, E-mail viruses have made the process much more confusing by adding the additional layers of authentication. But now, in Windows PowerShell 2.0, you can use the Send-MailMessage cmdlet in order to simplify the task of sending E-mail from a script.

At the same time, the cmdlet is able to work (In some cases) without any additional configuration on the network. However, it is required to grant the user account that is in use to run the script permission to send E-mail from the script for other times.

By ,