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:


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
At line:1 char:1
+ (New-Object Net.WebClient).DownloadFile('https://mycompany ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : WebException

1 Answer 1


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


  • 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.
    – Jacob
    Commented Jun 21, 2018 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.