Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Get-ChildItem D: -Recurse -File | Measure-Object | %{$_.Count}
- $Count = Get-ChildItem D: -Recurse -File | Measure-Object | %{$_.Count}
- $Status= $Event.Message
- $From = "sender@sender.com"
- $To = "receiver"
- $SMTPServer = "smtp"
- $SMTPPort = "587"
- $Username = "email@email.us"
- $Password = "password"
- $Subject = "$computer,Files count"
- $Body = "Number of Files is $Count |D drive test "
- $smtp = New-Object System.Net.Mail.SmtpClient($SMTPServer, $SMTPPort);
- $smtp.EnableSSL = $false
- $smtp.Credentials = New-Object System.Net.NetworkCredential($Username, $Password);
- $smtp.Send($From, $To, $subject, $body);
- $computer = "$env:computername
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement