0

A script we were running that automatically saved a couple of mail attachments to a network share quit working about a month ago.  The script is run from Task Scheduler.  The account password is saved to an encrypted file.  No one is logged onto the device when it is ran. It was based on this script:  https://gallery.technet.microsoft.com/office/O365-Email-Attachments-to-6a45e84c

I’m getting a 403 Forbidden error on the $messages = Invoke-RestMethod line.

I’ve looked over the documentation for the version 2 api:  https://docs.microsoft.com/en-us/previous-versions/office/office-365-api/api/version-2.0/use-outlook-rest-api#ShortRegAuthWorkflow 

But it seems very complex for what I want to do.  I tried to register an app like it says but none of that makes any sense to me either.  Can someone provide some example code/steps that I need to do or suggest something else that will work?  We want this to be fully automated.  It is a daily thing that comes to us and it needs to be saved to a network share so we can perform additional tasks like import to a SQL Table.

I think I tried using Flow when we first set this up but I’ll take a look at that again.  I’ve used it to replicate SharePoint Libraries to a network share.

 

(Visited 105 times, 1 visits today)
Mark Jones Changed status to publish February 15, 2019
Add a Comment