Skip to content

Instantly share code, notes, and snippets.

@hardware
Created August 23, 2016 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hardware/efeb8b112e4f68a55aa0c01786c08e2a to your computer and use it in GitHub Desktop.
Save hardware/efeb8b112e4f68a55aa0c01786c08e2a to your computer and use it in GitHub Desktop.
$user = $env:USERNAME
$username = Get-ADUser $user -Properties GivenName | Select-Object -ExpandProperty GivenName
$usermail = Get-ADUser $user -Properties mail | Select-Object -ExpandProperty mail
$mailAddrList = "..."
$Outlook = New-Object -ComObject Outlook.Application
$Mail = $Outlook.CreateItem(0)
$Mail.To = $mailAddrList
$Mail.Subject = "Viennoiseries de fin des vacances "
$Mail.Body ="Bonjour à tous,
Afin de marquer le coup après cette période de congés, je vous invite tous à partager quelques viennoieries sur le plateau du DIT à 10:00 l'un des mardis et jeudis des prochaines semaines à venir. Bien entendu, c'est moi qui régale :)
Cordialement,
$username
"
$Mail.Send()
[System.Reflection.Assembly]::LoadWithPartialName(“System.Windows.Forms”)
[Windows.Forms.MessageBox]::Show(“Erreur d'exécution de MyAwesomePing”,“Erreur choco”, [Windows.Forms.MessageBoxButtons]::OK, [Windows.Forms.MessageBoxIcon]::Error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment