Tech Blogs

Menu

This script creates reports per customer and send it to a specified e-mail address. Important: – This script is for multiple DPM servers, change it to a single one or add more – This script filters on hyper-v guests and the on a prefix, each customer should have a prefix – Edit smtp, email address…

This script will query alle DPM targets and present all back-up’s that haven’t been done the last 48 hours. It was initially designed to work with Zabbix. You can create an item in zabbix that can read the output file as html. You can use this item then for a screen. Secondly it creates a…

This script will put your PC in hibernation with an delay. Save script as an .ps1 file, double click and fill in delay. Script will show an progress bar, with time remaining plus percentage. As you can tell, you can modify this script to do whatever you want. It’s mostly about the delay and the…

This script creates an outlook e-mail, fill it with predefined data and can send it automatically. I used as much variables as I could an put them in top. Important: you gotta have an configured outlook profile, or it won’t work!

PowerShell

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

#

# Send mail via Outlook with attachment

#

#

# By Thom Kortekaas

# Created: 22-11-2013

# Modified: 22-11-2013

#

##########################################################

### Fill variables ###

##########################################################

$Attachment="C:\Users\Thom\Desktop\testfile.txt"

$Recipients="user@domain.tld"

$Subject="Rapport 2013"

$Body="See attachment"

##########################################################

### Setup mail ###

##########################################################

#Create outlook instance

$Outlook=new-object-comobjectoutlook.application

#Create new mail item

$NewMail=$Outlook.CreateItem(0)

#Display mail item to user

$NewMail.display()

##########################################################

#Fill email with data, 1 second delay for each step ###

##########################################################

#Fill in recipients

start-sleep-s1

$NewMail.To=$Recipients

#Fill in subject

start-sleep-s1

$NewMail.Subject=$Subject

#Fill in body while preserving current body (signature)

start-sleep-s1

$oldbody=$NewMail.HTMLBody

$newbody=$Body

$newbody+=$oldbody

$NewMail.HTMLBody=$newbody

##########################################################

### Add attachment if given ###

##########################################################

#Check if variable $Attachment has a value to begin with, if not skip attachment

This script will create a report from your hyper-V servers from your Virtual Machine Manager 2012. This report will be automatically emailed to a number of persons. Important: 1. All hypervisors should be server 2012. 2. If your native OS language is English and you use a different language notation in combination with an English…