Advertisement
Guest User

Untitled

a guest
Mar 7th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. Get-ChildItem D: -Recurse -File | Measure-Object | %{$_.Count}
  2.  
  3. $Count = Get-ChildItem D: -Recurse -File | Measure-Object | %{$_.Count}
  4. $Status= $Event.Message
  5. $From = "sender@sender.com"
  6. $To = "receiver"
  7. $SMTPServer = "smtp"
  8. $SMTPPort = "587"
  9. $Username = "email@email.us"
  10. $Password = "password"
  11. $Subject = "$computer,Files count"
  12. $Body = "Number of Files is $Count |D drive test "
  13. $smtp = New-Object System.Net.Mail.SmtpClient($SMTPServer, $SMTPPort);
  14. $smtp.EnableSSL = $false
  15. $smtp.Credentials = New-Object System.Net.NetworkCredential($Username, $Password);
  16. $smtp.Send($From, $To, $subject, $body);
  17. $computer = "$env:computername
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement