update scripts
This commit is contained in:
parent
566cebdc96
commit
a5a3637b5c
14 changed files with 6289 additions and 5805 deletions
22
Scripts/Send-Message-PIV.ps1
Normal file
22
Scripts/Send-Message-PIV.ps1
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
$Username = "support@domain.local";
|
||||
$Password = "password";
|
||||
$SendTo = "admin@domain.ru";
|
||||
$MailServer = "mail.domain.ru";
|
||||
$HostName = $args[0];
|
||||
$IPAddress = $args[1];
|
||||
$PingStatus = $args[2];
|
||||
$FailedOn = $args[3];
|
||||
|
||||
$message = new-object Net.Mail.MailMessage;
|
||||
$message.From = $Username;
|
||||
$message.To.Add($SendTo);
|
||||
$message.Subject = "Ping Info View";
|
||||
$message.Body = "Failed ping: `r`nHost Name: $HostName`r`nIP Address: $IPAddress`r`nPing Status: $PingStatus`r`nPing Time: $FailedOn";
|
||||
|
||||
$smtp = new-object Net.Mail.SmtpClient($MailServer, "25");
|
||||
$smtp.EnableSSL = $true;
|
||||
$smtp.Credentials = New-Object System.Net.NetworkCredential($Username, $Password);
|
||||
$smtp.send($message);
|
||||
|
||||
# F9 - Advanced Options - Execute the following command on failed ping:
|
||||
# Powershell.exe -executionpolicy remotesigned -File С:\Send-Message-PIV.ps1 "%HostName%" "%IPAddress%" "%LastPingStatus%" "%LastFailedOn%"
|
||||
Loading…
Add table
Add a link
Reference in a new issue