SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here's an odd one:

I have a content type derived from SPFolder, that I am creating through code. As part of the creation process, I am trying to set the "Created By" information to be the user who should be attributed as the creator of the folder. I'm using the following code:

// after setting some other field values:

SPFieldUserValue userValue = new SPFieldUserValue(web, user.ID, user.LoginName);
folderItem[SPBuiltInFieldId.Author] = userValue;
folderItem[SPBuiltInFieldId.Created_x0020_By] = userValue;

Now, if I go in with Powershell or SharePoint Manager, I can see that in the folder's properties and in the folder's item's properties, the value of vti_author and display_urn:schemas-microsoft-com:office:office#Author is the correct user value, and the only place I can find SHAREPOINT\system is in vti_modifiedby.

However, when I go and view properties of the folder (through the SharePoint UI), in the view form, the System Account is listed for both created by and modified by. And, if I add "Created By" to the list view, it's all System Account there too.

So where is SharePoint pulling that from? What other mystery field do I need to set to get my user as the Created By person?

share|improve this question
Have you tried setting the Author field to just an SPUser object. I have done this before and that worked. – spevilgenius Apr 5 '14 at 9:58
@spevilgenius, thanks for the suggestion, but that did not work. Using an SPUser object still ends up showing created by System Account in both view form and list view. – Dylan Cristy Apr 7 '14 at 14:18
Impersonate as that user and create folder under his account. That should do the trick. Code… – luccio Apr 11 '14 at 8:14
up vote 0 down vote accepted

If you want to manipulate the system properties (author, editor, ...) you'll have to use SPListItem.UpdateOverwriteVersion()

SPListItem item = ...; 
item["Created By"] = web.EnsureUser("luisb").ID; 
item["Modified By"] = item["Modified By"]; 
item["Created"] = DateTime.Now.AddYears(-3); 
item["Modified"] = DateTime.Parse("01/01/2000"); 

See this post:

share|improve this answer
That did the trick! Thanks Steven. – Dylan Cristy May 9 '14 at 16:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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