SharePoint CSOM Upload File Access Denied Error

Using a .Net Web App, a simple process is to create a local file and upload it to SharePoint. I thought the service account I was using had ample permissions to the Site, but it didn’t… For testing, I granted the service account Full Control at the Web App level (user policy), site collection admin, and more. Nothing worked.

Sample of the code I was using:

ClientContext ctxH = new ClientContext(hURL); 
Web siteH = ctxH.Web; 

List _library = siteH.Lists.GetByTitle("Drop Off Library"); 
Folder _oFolder = siteH.GetFolderByServerRelativeUrl(siteH.ServerRelativeUrl.TrimEnd('/') + "/" + "DropOffLibrary"); 

FileStream fileStream = System.IO.File.OpenRead(fileName); FileCreationInformation fileInfo = new FileCreationInformation(); fileInfo.ContentStream = fileStream; fileInfo.Overwrite = true; fileInfo.Url = destFileName; Microsoft.SharePoint.Client.File _oFile = _oFolder.Files.Add(fileInfo); 


STSADM Access Denied Server 2003

Recently was tasked with updating passwords on an older SharePoint 2007 farm.  The fun part, Windows Server 2003 was the host OS.   I hit a wall right out of the gate when I tried to run my STSADM command.

STSADM.EXE -o updatefarmcredentials -identitytype configurableid -userlogin “domain\SP_Admin” -password Cool@Password

Error: Access Denied

What the $#%##, I know I have full access to the farm and databases.

In Windows Server 2003, to launch the command prompt, right-click and select Run As.  THEN, un-check Run this program with restricted access.  Now run the STSADM command again.