Get-EmailMessages
  • 1 Minute to read
  • Dark
    Light
  • PDF

Get-EmailMessages

  • Dark
    Light
  • PDF

Article summary

Summary

Retrieves a collection of email message objects.

Get-EmailMessages
    -Top
    -Skip
    -Filter
    -OrderBy

Returns a collection object with the following properties:

Property

Type

Notes

Collection

Collection of email message objects

The collection of entries retrieved after top, skip, filter, and order by parameters were applied.

Top

Int32

The top parameter value that was used. Useful while paging data.

Skip

Int32

The skip parameter value that was used. Useful while paging data.

TotalCount

Int32

The total count of records available after any filtering was applied. Useful while paging data.

Parameters

Parameter

Type

Required?

Notes

Top

Int32

No, Defaults to 40

Total number of entries to retrieve. Max is 1000.

Skip

Int32

No, Defaults to 0

How many entries should be skipped within the collection. Used for paging the results.

Filter

String

No

An OData 4 string that can be used for filtering the collection.

OrderBy

String

No

An OData 4 string that can be used for sorting the collection by specific fields.

Examples

Get a collection of email messages

# Retrieve one record from the collection, since we're only interested in the total count.
$collectionWrapper = Get-EmailMessages -Top 1

Write-Output "There are $($collectionWrapper.TotalCount) email message(s) in the workspace"
There are 45 email message(s) in the workspace