0

I have a few files on my team's SharePoint site (in Office 365) that are shared with a public link--anyone with the link can view. For several months, I have had a process that uses PowerShell's DownloadFile() function to save these files to users' local C:\ drives.

Sometime this week (or perhaps last), SharePoint has started returning a 500 Internal Server Error message. The share links follow this format:

https://mycompany.sharepoint.com/sites/mypath/mypath/myteam/_layouts/15/download.aspx?docid=bunchofrandomcharacters&authkey=bunchofrandomcharacters 

I can put the share links into both the IE and Chrome web browsers and the files download as expected, so apparently nothing has changed with the shares' availability. (Firefox returns a "Server Error in '/' Application" message, but I don't know if it would have worked before this.)

Why would DownloadFile() be different suddenly? And more importantly, is there a way to fix it?

Thanks, Jacob

edit: here's the complete error message from the PowerShell command prompt in case it's useful:

Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an error: (500) Internal Server Error." At line:1 char:1 + (New-Object Net.WebClient).DownloadFile('https://mycompany ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : WebException 

1 Answer 1

0

I suggest logging a ticket with Microsoft o365 support. They may have detected your script and blocked or throttled it.

https://docs.microsoft.com/en-us/sharepoint/dev/general-development/how-to-avoid-getting-throttled-or-blocked-in-sharepoint-online

1
  • Good idea to log a ticket. Based on the article, I doubt it's throttling. There are relatively few regular users (maybe 100), the file sizes are KB/MB not MB/GB, and they'd each be calling the files only infrequently; the smallest file maybe 1-2x per day for the "heaviest" users, and the largest file maybe once every month or two. Commented Jun 21, 2018 at 11:45

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.