If you've received this error while running a PowerShell script on a SharePoint farm then I commiserate with you but I found the answer, so hopefully this will help someone else since I could not find any answers via Google.
I have written a PowerShell script that moves files from one Document Library to another in the same site collection.
The document Library is email enabled and receives hundreds of emails a day. One of the requirements was to extract the domain name of the sender from their email address. Then write this domain name as metadata into a custom column. That bit works and was no big deal.
Then I have a script that moves the file into an archive Document Library, as mentioned before.
The problem came when we decided that it would be a good idea to create folders based on the domain name.
So after some research I was able to modify my script and proceeded to run it.
Almost every file failed with an exception:
Exception calling "Update" with "0" argument(s): "The file you are attempting to save or retrieve has been blocked from this Web site by the server administrators."
At line:1 char:6
+ CategoryInfo : NotSpecified: (:) , MethodInvocationException
+ FullyQualifiedErrorId : SPException
The bit of code that was causing this was:
$TargetFolder = $TargetList.Folders.Add("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder, $DomainName)
I checked the domain and sure enough there was a valid domain name "thisdomain.com"
The Update() part was the bit that through the error.
I checked the destination and noticed that some folders had been created:
Then it twigged. Wait a minute, the error says that the file is blocked. I'm trying to create a folder with a .com extension. Some executables are .com mostly replaced these days by .exe.
So I went and checked the bloacked file typse in SharePoint Central Administration -> Security -> Define blocked file types. Sure enough "com" was listed so I took it out.
I ran my script again and voila everything worked and the "thisdomain.com" was created.
Of course there is a risk that someone will upload an executable.com file into SharePoint (the blocked file tyoes is by Web Application, so no granular controls that I am aware of) but this is an internal Intranet so should be safe.
Hope this helps some one else out.