Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $From = "rayonaboat@gmail.com"
- $To = "ccxgt@yahoo.com"
- $Subject = Get-Date
- $Body = (gwmi WIN32_ComputerSystem)
- $SMTPServer = "smtp.gmail.com"
- $Path = "C:\Users\Public\Test.html"
- $Credentials = Get-Credentials
- Get-Process | Select-Object Name, Path, CPU, ProductVersion, Id, PriorityClass, PagedMemorySize | ConvertTo-HTML | Out-File C:\Users\Public\Test.html -force
- Get-Service | Select-Object Status, Name, DisplayName | ConvertTo-HTML | Out-File C:\Users\Public\Test.html -append
- Send-MailMessage -From $From -to $To -Subject $Subject `
- -Body $Body -SmtpServer $SMTPServer -UseSsl `
- -Credential $Credentials -Attachments $Path
- Remove-Item $Path
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement