The syntax is simple, so an example will be enough:
Once you have defined and run your query, the next step is to process the call results. The first step is to check the main result value from the query call. The result value should be an object and not the Null value. If you encounter a Null value, there is a problem. For information about what to check in this case, see the section titled Notes about using theOData client library .
The next step depends on the type of query you are running.
This code goes with the example in the section that follows.
Between($i_startDate, $i_endDate).`
"Recipients", $any, $filter::Clause(`
"EmailAddress.Person.Department", $equal, $i_department))).`
Select("Sender.EmailAddress.DisplayName", "SendDate", "Subject").`
ForEach ($message in $messages)
Write-Host $message.Sender.EmailAddress.DisplayName
Here is an example about how to access the main values:
WithinLast($i_numberOfWeeks, $weeks).`
"Recipients", $any, $filter::Clause(`
"EmailAddress.Person.Department", $equal, $i_department))).`
if ($result.Metrics.Count -gt 0)
Write-Host $metric.MetricId $metric.GroupResults.Value
Write-Host $metric. MetricId $metric.GroupResults.Value
This results in two lines being written for each metric:
For("EmailMessageParticipants").`
GroupBy("EmailAddress.Person.CountryOrRegion").`
TrendBy("Message.Timestamp", $daily).`
Write-Host Total Messages: $result.TotalObjects
if ($result.Metrics.Count -gt 0)
Write-Host $metric.MetricId : $metric.Value
ForEach ($countryGroup in $metric.GroupResults.Groups)
Write-Host $countryGroup.Key : $countryGroup.Value
ForEach ($dayGroup in $countryGroup.Groups)
© ALL RIGHTS RESERVED. 利用規約 プライバシー Cookie Preference Center