Freigeben über


About: Using REST with PowerShell

PowerShell can be used with REST to work with the content of mailboxes and perform the many of the operations which can be done with APIs such as Exchange Web Services. Some have had a hard time tracking down information and samples in this area, so I have compiled ones I have found to make such content easier to find.

Please note that in November 2018 that the REST 1.0 endpoint will be disabled and that you will need to start using the 2.0 endpoint. If your starting a new application, then also consider using Graph instead if it has the calls you need – it's what is advised if you are going against Exchange Online and can migrate at this time or are starting a new program.

Articles on using REST with PowerShell:

Using the Office365/Exchange 2016 REST API to access Mailbox data using PowerShell part 1
https://gsexdev.blogspot.com/2017/02/using-office365exchange-2016-rest-api.html

Using the Office365/Exchange 2016 REST API part 2 building an Admin Runner using AppOnly tokens
https://gsexdev.blogspot.com/2017/03/

Using the Office365/Exchange 2016 REST API to access Mailbox data using PowerShell part 3
https://gsexdev.blogspot.com/2017/04/

Using the Office365/Exchange 2016 REST API to access Mailbox data using PowerShell part 4
https://gsexdev.blogspot.com/2017/05/using-office365exchange-2016-rest-api.html

Using the Office365/Exchange 2016 REST API to access Mailbox data using PowerShell part 5 Sending
https://gsexdev.blogspot.com/2017/06/

Using the Office365/Exchange 2016 REST API for working with Mailbox and OneDrive files/attachments
https://gsexdev.blogspot.com/2017/07/

Simple scripted download Attachment using the Graph or Outlook Rest API in Office365
https://gsexdev.blogspot.com/2017/07/simple-scripted-download-attachment.html

Using the Office365/Exchange 2016 REST API Calendaring
https://gsexdev.blogspot.com/2017/09/

Export Contacts from a Mailbox Contacts Folder or Public Folder to a CSV file using EWS and REST
https://gsexdev.blogspot.com/2017/10

Showing all your Room Mailboxes in Office365 using the Graph REST API
https://gsexdev.blogspot.com/2017/10/showing-all-your-room-mailboxes-in.html

Simple Mail Gui's for the REST API on Office365 and Exchange 2016
https://gsexdev.blogspot.com/2017/11/simple-mail-guis-for-rest-api-on.html

Searching Mailbox folders using the REST API In Powershell on Office365 and Exchange 2016
https://gsexdev.blogspot.com/2018/02/searching-mailbox-folders-using-rest.html

Using the Office365/Exchange 2016 REST API in Powershell Contacts
https://gsexdev.blogspot.com/2018/03/using-office365exchange-2016-rest-api.html

GDPR and your Exchange / Office365 Contacts from a data perspective
https://gsexdev.blogspot.com/2018/05/gdpr-and-your-exchange-office365.html

Parsing and reporting on hyperlinks in email using EWS and REST (eg looking for baseStriker) in Exchange and Office365
https://gsexdev.blogspot.com/2018/05/parsing-and-reporting-on-hyperlinks-in.html

Junk Email reporting with PowerShell in Office365 Part 1
https://gsexdev.blogspot.com/2018/05/junk-email-reporting-with-powershell-in.html

Junk Email reporting with PowerShell in Office365 Part 2
https://gsexdev.blogspot.com/2018/05/junk-email-reporting-with-powershell-in_9.html

Using the Office 365 Management Activity API from Powershell to audit Exchange and Office365
https://gsexdev.blogspot.com/2018/06/using-office-365-management-activity.html

Exch-Rest
https://github.com/gscales/Exch-Rest

Reference:

Overview of using the Outlook REST APIs
/en-us/outlook/rest/get-started

Outlook Mail REST API reference (version 2.0)
/en-us/previous-versions/office/office-365-api/api/version-2.0/mail-rest-operations

Invoke-RestMethod
/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-6

Invoke-WebRequest
/en-us/powershell/module/microsoft.powershell.utility/invoke-webrequest?view=powershell-6

Related:

About: Using EWS and PowerShell
https://blogs.msdn.microsoft.com/webdav_101/2018/06/19/about-using-ews-and-powershell/