forked from linkedin/pyexchange
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting.py
More file actions
64 lines (21 loc) · 820 Bytes
/
testing.py
File metadata and controls
64 lines (21 loc) · 820 Bytes
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
from pyexchange import Exchange2010Service, ExchangeNTLMAuthConnection
URL = u'https://mail.vanroey.be/EWS/Exchange.asmx'
USERNAME = u'DOMAIN\\yenthe'
PASSWORD = u"mypass"
from datetime import datetime
from pytz import timezone
# Set up the connection to Exchange
connection = ExchangeNTLMAuthConnection(url=URL,
username=USERNAME,
password=PASSWORD)
service = Exchange2010Service(connection)
# You can set event properties when you instantiate the event...
contact = service.contact().new_contact(
name=u"80s Movie night",
company_name = u"My house",
)
# ...or afterwards
contact.name = u"Yenthe"
contact.company_name = u"Van Roey"
# Connect to Exchange and create the event
contact.create()