Allgemein IT Powershell

Prank your Colleagues

If you wanna Prank your Colleagues or even your whole Company: Add the E-mail of every Meeting Room in the Company to the $MeetingRooms Array and run this Script. This Script will create 30min Appointments in every room for a whole day.

In one of my Old companies it was tradition to troll the other Coworkers when you’re leaving and I decided to fill up their 1st of April in 2020 so they will remember me when they search for an Appointment.

$ol = New-Object -ComObject Outlook.Application
$PrankDate = "04/01/2020"
$MeetingRooms = @("SZiWP17E068@company.ch", "SZiWP17E10.1014Plaetze@company.ch", "SZiWP17E10.1310Pl.Beamer@company.ch", "SZiWP17E7.16Plaetze@company.ch", "SZiWP17E7.16Plaetze@company.ch", "SZiWP17E7.26Plaetze@company.ch", "SZiWP17E710Pl.Beamer@company.ch", "SZiWP19214BC15Pl.Beamer@company.ch", "SZiWP19307D12Pl.Beamer@company.ch", "SZiWP19309B6Plaetze@company.ch", "SZiWP19309D8Plaetze@company.ch", "SZi_WP19_311B_5@company.ch", "SZiWP19311D8Plaetze@company.ch", "SZiWP19412D12Pl.Beamer@company.ch", "SZiWP21122D8Plaetze@company.ch", "SZiWP21123C8Plaetze@company.ch", "SZiWP21129C12Pl.Beamer@company.ch", "SZiWP21219D6Plaetze@company.ch", "SZiWP21220B12Pl.Beamer@company.ch", "SZiWP21220C6Plaetze@company.ch", "SZiWP21228B10Pl.Beamer@company.ch", "SZiWP21319D14Pl.Beamer@company.ch", "SZiWP21420B12Pl.Beamer@company.ch", "SZiWP21420D12Pl@company.ch", "SZiWP21429B6Plaetze@company.ch")

$Pstart = [datetime]($PrankDate + " 08:00:00")
$Pend = [datetime]($PrankDate + " 17:00:00")
do {
	
	$ol = New-Object -ComObject Outlook.Application
	$meeting = $ol.CreateItem('olAppointmentItem')
	$meeting.Subject = "company Fiesta"
	$meeting.Body = "Platzhalter für speziellen Event!"
	$meeting.Location = "Bern"
	$meeting.ReminderSet = $false
	$meeting.Importance = 1
	$meeting.MeetingStatus = [Microsoft.Office.Interop.Outlook.OlMeetingStatus]::olMeeting
	foreach ($SiZi in $MeetingRooms)
	{
		$meeting.Recipients.Add($SiZi)
	}
	$meeting.ReminderMinutesBeforeStart = 0
	$meeting.Start = $Pstart
	$meeting.Duration = 30
	$meeting.Send()
	
	$Pstart = $Pstart.addMinutes(30)
}
until ($Pstart -ge $Pend)

Write-Host "A whole Day has been trolled"