Advertisement
Guest User

Untitled

a guest
Mar 31st, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #function check BDRSET
  2.  
  3. $BDR=Get-WmiObject -query "Select * from Win32_logicaldisk" | select volumeName
  4.  
  5. if ($BDR=volumeName -eq "BDRSET01") {
  6. {
  7. $body="Hi james's please change BDR set and connect BDRset02 "}
  8.  
  9.  
  10. } elseIf ($BDR=volumeName -eq "BDRSET02"){
  11. $body="Hi james's please change BDR set and connect BDRset01"
  12. }
  13.  
  14. $From = "reporter@domain.com"
  15. $To = "client@client.com"
  16. $SMTPServer = "smtp server"
  17. $SMTPPort = "587"
  18. $Username = "reporter@domain.com"
  19. $Password = "P@ssword"
  20. $Subject = "Important - Switch BDR Device"
  21. $Body = $body
  22. $smtp = New-Object System.Net.Mail.SmtpClient($SMTPServer, $SMTPPort);
  23. $smtp.EnableSSL = $false
  24. $smtp.Credentials = New-Object System.Net.NetworkCredential($Username, $Password);
  25. $smtp.Send($From, $To, $subject, $body);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement