Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #function check BDRSET
- $BDR=Get-WmiObject -query "Select * from Win32_logicaldisk" | select volumeName
- if ($BDR=volumeName -eq "BDRSET01") {
- {
- $body="Hi james's please change BDR set and connect BDRset02 "}
- } elseIf ($BDR=volumeName -eq "BDRSET02"){
- $body="Hi james's please change BDR set and connect BDRset01"
- }
- $From = "reporter@domain.com"
- $To = "client@client.com"
- $SMTPServer = "smtp server"
- $SMTPPort = "587"
- $Username = "reporter@domain.com"
- $Password = "P@ssword"
- $Subject = "Important - Switch BDR Device"
- $Body = $body
- $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);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement