Open Crewsr opened 4 years ago
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:
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.
@Crewsr I agree with @paulwetter. I would just use a wrapper script to call DocumentConfigMgrCB then do whatever I wanted with the HTML output.
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