Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

exchange 2010 EWS - retrieving the body text of an appouintment

$
0
0

Hi All,

I hope someone out there can help me with this one... OK... first a little background as to what I am attempting

I have  written an app in PowerShell to work with System Centre Service Manager (2010) which looks at scheduled tasks for engineers and adds them into their outlook calendar, so they have all the call details on their phones - will also allow managewrs to send updates and new work to them easily.  I have used EWS to create these entries like this...

$Appointment = New-Object Microsoft.Exchange.WebServices.Data.Appointment -ArgumentList $service  
#Set Start Time  
$Appointment.Start = $incident.Scheduled
#Set End Time  
$Appointment.End = ($Appointment.Start).AddMinutes(30)
#Set Subject  
$Appointment.Subject = $incident.SourceObject.DisplayName 
#Set the Location  
$Appointment.Location = $incident.sitename   
#Set Reminder
$Appointment.ReminderMinutesBeforeStart = 30
#Set any Notes  
$Appointment.Body = $incident.firstline+"<br>"+$incident.postcode+"<br><b>Affected User:   </b>"+$incident.affecteduser +"<br><b>About Config Item:  </b>"+$incident.RelatedItems+"<br><br><b><u>Description:</u></b><br>"+     $incident.SourceObject.Values.Item(25).value+"<br><br><b><u>Call Logs:</u></b><br>"+     $incident.logs
#Create Appointment will save to the default Calendar  
$Appointment.Save($folderid)

What I wanted to do was allow the engineers to update this calendar appointment on the go and for this to and for this to feed back into service manager.  I can retrieve the calendar appointment - again using EWS - but the "body" field is always blank.

So the question...

if the body of the appointment is not in the Body field, where is and how do I get to it? 

below is how I retrieve the appointment

thanks in advance...

Ed

$global:CalendarFolder = [Microsoft.Exchange.WebServices.Data.CalendarFolder]::Bind($service,$folderid)
            $cvCalendarview = new-object Microsoft.Exchange.WebServices.Data.CalendarView($today,$1week,2000)
            $cvCalendarview.PropertySet = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties)
            $global:CalendarResult = $CalendarFolder.FindAppointments($cvCalendarview) <# |select Start, subject, End, Location, body, LastModifiedTime #> |?{$_.subject -like 'IR*'}
### filter to a single appointment
$CalApp =   $CalendarResult |?{$_.subject -like $incident.SourceObject.DisplayName }
###
#
#   $CalApp.body is blank  


Ed


Viewing all articles
Browse latest Browse all 7132

Trending Articles