EWS::Client - Microsoft Exchange Web Services Client
version 1.113000
Set up your Exchange Web Services client.
use EWS::Client; use DateTime; my $ews = EWS::Client->new({ server => 'exchangeserver.example.com', username => 'oliver', password => 's3krit', # or set in $ENV{EWS_PASS} });
Then perform operations on the Exchange server:
my $entries = $ews->calendar->retrieve({ start => DateTime->now(), end => DateTime->now->add( months => 1 ), }); print "I retrieved ". $entries->count ." items\n"; while ($entries->has_next) { print $entries->next->Subject, "\n"; } my $contacts = $ews->contacts->retrieve;
This module acts as a client to the Microsoft Exchange Web Services API. From here you can access calendar and contact entries in a nicely abstracted fashion. Query results are generally available in an iterator and convenience methods exist to access the properties of each entry.
Depending on the configuration of the Microsoft Exchange server, you can use either HTTP Basic Access Auth, or NTLM Negotiated Auth, from this module. The default is HTTP Basic Access Auth, so if using NTLM, the following additional option to new() is required:
new()
use_negotiated_auth => 1,
Instantiates a new EWS client. There won't be any connection to the server until you call one of the calendar or contacts retrieval methods.
server
The host name of the Exchange server to which the module should connect.
username
The account username under which the module will connect to Exchange.
For Basic Access Auth this value will be URI encoded by the module, meaning you don't have to worry about escaping any special characters. For NTLM Negotiated Auth, pass a user@domain format username and it will automatically be converted into Windows' domain\user format for you.
user@domain
domain\user
password
$ENV{EWS_PASS}
The password of the account under which the module will connect to Exchange.
For Basic Access Auth this value will be URI encoded by the module. You can also provide the password via the EWS_PASS environment variable.
EWS_PASS
use_negotiated_auth
The module will assume you wish to use HTTP Basic Access Auth, in which case you should enable that in your Exchange server. However for negotiated methods such as NTLM set this to a True value.
schema_path
A folder on your file system which contains the WSDL and two further Schema files (messages, and types) which describe the Exchange 2007 Web Services SOAP API. They are shipped with this module so your providing this is optional.
server_version
In each request to the server is specified the API version we expect to use. By default this is set to Exchange2007_SP1 but you have the opportunity to set it to Exchange2007 if you wish using this option.
Exchange2007_SP1
Exchange2007
Retrieves the EWS::Client::Calendar object which allows search and retrieval of calendar entries and their various properties. See that linked manual page for more details.
Retrieves the EWS::Client::Contacts object which allows retrieval of contact entries and their telephone numbers. See that linked manual page for more details.
No handling of time zone information, sorry.
The SOAPAction Header might be wrong for Exchange 2010.
SOAPAction
To Greg Shaw for sending patches for NTLM Authentication support and User Impersonation.
Oliver Gorwits <oliver@cpan.org>
This software is copyright (c) 2011 by University of Oxford.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install EWS::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm EWS::Client
CPAN shell
perl -MCPAN -e shell install EWS::Client
For more information on module installation, please visit the detailed CPAN module installation guide.