You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At line 79, I added:
[parameter(Mandatory=$False)]
[string]$SMTPServer = "SMTP",
[parameter(Mandatory=$False)]
[string]$MailTo = "Richard Crews ",
[parameter(Mandatory=$False)]
[string]$MailFrom = "SCCM Monitor ",
[parameter(Mandatory=$False)]
[string]$SubjectLine = "SCCM Documentor",
[parameter(Mandatory=$False)]
[string]$CopyPath = "DocumentationFolderPath",
At the end I added:
Write-host "Beginning copy of $FilePath to $CopyPath"
Copy-Item $FilePath -Destination "$CopyPath" -Force
Write-host "Sending email."
Send-MailMessage -From $MailFrom -To $MailTo -Subject $SubjectLine -Body "Completed execution at $($ScriptEndTime.ToShortTimeString()) with a total execution time of $ExecTimeString
A copy of the report has been saved to $CopyPath" -Attachments $FilePath -Priority High -SmtpServer $SmtpServer
The text was updated successfully, but these errors were encountered:
I don't know that this is something i would build into the script. But, perhaps I'll update the script to return a basic object that could be used in a wrapper for email and archiving.
Object could include:
Script version
Documentation File Name and path
Execution Time
Start Time
End Time
And really, archiving can be achieved by using the -AddDateTime switch parameter as it will append the date and time to the end of the file name.
At line 79, I added:
[parameter(Mandatory=$False)]
[string]$SMTPServer = "SMTP",
[parameter(Mandatory=$False)]
[string]$MailTo = "Richard Crews ",
[parameter(Mandatory=$False)]
[string]$MailFrom = "SCCM Monitor ",
[parameter(Mandatory=$False)]
[string]$SubjectLine = "SCCM Documentor",
[parameter(Mandatory=$False)]
[string]$CopyPath = "DocumentationFolderPath",
At the end I added:$SubjectLine -Body "Completed execution at $ ($ScriptEndTime.ToShortTimeString()) with a total execution time of $ExecTimeString
Write-host "Beginning copy of $FilePath to $CopyPath"
Copy-Item $FilePath -Destination "$CopyPath" -Force
Write-host "Sending email."
Send-MailMessage -From $MailFrom -To $MailTo -Subject
A copy of the report has been saved to $CopyPath" -Attachments $FilePath -Priority High -SmtpServer $SmtpServer
The text was updated successfully, but these errors were encountered: