Skip to content

Instantly share code, notes, and snippets.

@zenchild
Created August 18, 2011 02:41
Show Gist options
  • Save zenchild/1153169 to your computer and use it in GitHub Desktop.
Save zenchild/1153169 to your computer and use it in GitHub Desktop.
Getting delegate access to another users Exchange folder in Viewpoint
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