Bonjour,
J'aimerais selon une condition, envoyer un mail automatique en Powershell.
J'ai mis en place une condition :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 $SMTPServer = "test.test.group" $From = "aaaa@aaa.net" $To = "aaaa@aaa.net" [String]$subject = "trop de fichiers" [String]$body = "Test" # --------------------------------------------------------------- AFFICHAGE DES VARIABLES ---------------------------------------------------------------------- if ($nbfichiers -ge $max) { Send-MailMessage -To $To -From $From -Subject $subject -StmpServer $SMTPServer -Body $body Write-Host "Mail envoyé" }
Partager