Created
August 18, 2011 02:41
-
-
Save zenchild/1153169 to your computer and use it in GitHub Desktop.
Getting delegate access to another users Exchange folder in Viewpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'viewpoint' | |
include Viewpoint::EWS | |
puts "Usage: cal_items.rb <email>" if ARGV.length == 0 | |
email = ARGV[0] | |
cfile="creds_test.json" | |
creds = JSON.load(File.open(cfile,'r')) | |
Viewpoint::EWS::EWS.endpoint = creds['endpoint'] | |
Viewpoint::EWS::EWS.set_auth(creds['user'],creds['pass']) | |
cal = GenericFolder.get_folder(:calendar, email) | |
items = cal.todays_items | |
items.each do |it| | |
it.deepen! | |
puts "Subject: #{it.subject}" | |
puts "Location: #{it.location}" | |
print "Attendees: " | |
it.required_attendees.each do |ra| | |
print " #{ra.name}" | |
end unless it.required_attendees.nil? | |
puts "" | |
puts "\tStart: #{it.start.new_offset('-6')}" | |
puts "\tEnd: #{it.end.new_offset('-6')}" | |
puts "-----------------------------------" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment