Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email and archiving #58

Open
Crewsr opened this issue Mar 13, 2020 · 2 comments
Open

Email and archiving #58

Crewsr opened this issue Mar 13, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@Crewsr
Copy link

Crewsr commented Mar 13, 2020

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

@paulwetter paulwetter added the enhancement New feature or request label Jul 8, 2020
@paulwetter
Copy link
Owner

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.

@ChadSimmons
Copy link
Contributor

@Crewsr I agree with @paulwetter. I would just use a wrapper script to call DocumentConfigMgrCB then do whatever I wanted with the HTML output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants