From 153ed4a0f8b6981e05d6756f4caa398d973ac768 Mon Sep 17 00:00:00 2001 From: Stephen Valdinger Date: Wed, 1 May 2019 12:37:35 -0700 Subject: [PATCH] Update Send-Mail.ps1 --- PSADHealth/Private/Send-Mail.ps1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PSADHealth/Private/Send-Mail.ps1 b/PSADHealth/Private/Send-Mail.ps1 index c4938dd..0f6f5f9 100644 --- a/PSADHealth/Private/Send-Mail.ps1 +++ b/PSADHealth/Private/Send-Mail.ps1 @@ -1,5 +1,9 @@ function Send-Mail { Param($emailOutput) + + begin { $null = Get-ADConfig } + + process { Write-Verbose "Sending Email" Write-eventlog -logname "Application" -Source "PSMonitor" -EventID 17034 -EntryType Information -message "ALERT Email Sent" -category "17034" Write-Verbose "Output is -- $emailOutput" @@ -38,4 +42,7 @@ function Send-Mail { #Send it $smtp.Send($msg) -} \ No newline at end of file + + } + +}