SharePoint Created By, Modified By fields Not showing correct username
We are currently using SharePoint 2007 and I have a user with Full Access to SharePoint. The user recently told me that his name showed under Created By and Modified By fields in which he did not create the folder, uploaded the files, or made any changes. For some files the Check in Comment appear as "Check in by 'username" using the the content and structure tool". Has anyone seen this issue before or just my user has short term memroy. :) Thansks...B
March 11th, 2011 4:05pm

Hi Bluem, I have seen this issue when we are running some piece of code with system account using SharePoint Object Model and that user [your user] is part of System Account.Regards, Avinash | avinashkt.blogspot.com
Free Windows Admin Tool Kit Click here and download it now
March 12th, 2011 11:02am

Hi Bluem, I have seen this issue when we are running some piece of code with system account using SharePoint Object Model and that user [your user] is part of System Account.Regards, Avinash | avinashkt.blogspot.com
March 12th, 2011 11:02am

Created By & Modified By columns are "Person or Goup" type columns. In SharePoint all the lists has these columns by default. You can't update the values of these columns from UI. But, you can do it through SharePoint APIs. I have created .NET windows based application to update the "created by" and "modified by" columns using SharePoint APIs. I am giving the sample code snippet below. /******** Code snippet for modifying the Created by and Modified by column values of a SharePoint List *******/ /******** Written in .Net Windows Based Application **********/ Sample Code snippet ------------------------------------- string strSite = "<SiteURL>"; string strFilePath = "C:\\test.aspx"; string strFileUrl = "TestDoc5"; SPSite oSite = new SPSite(strSite); SPWeb myWeb = oSite.OpenWeb(); SPFolder objFolder = oSite.OpenWeb().GetFolder("YesNo"); SPFileCollection objFiles = objFolder.Files ; byte[] myFile = new byte[1000]; SPUser myUser = myWeb.AllUsers["domain\\Email"]; FileStream mystream = new System.IO.FileStream(strFilePath ,FileMode.Open ,FileAccess.ReadWrite,FileShare.ReadWrite ); mystream.Read(myFile,0,1000); mystream.Close(); DateTime timeCreated = DateTime.Now.Subtract(new TimeSpan(1000, 0, 0, 0)); DateTime timeModified = DateTime.Now.Subtract(new TimeSpan(990, 0, 0, 0)); SPFile file = objFolder.Files.Add("PavanTest.doc", myFile, myUser, myUser, timeCreated, timeModified); SPListItem item = file.Item; item["Created"] = timeCreated; item["Modified"] = timeModified; file.Item.Update();
Free Windows Admin Tool Kit Click here and download it now
March 16th, 2011 7:53am

actually my issue is that the user told me that some files and folders show his name under the created by and modified by columns...but he never done any updates or uploaded the files to SharePoint.
March 16th, 2011 11:20am

Yes Bluem, we have discovered this very problem just today and I'll try to let you know if we come up with anything.
Free Windows Admin Tool Kit Click here and download it now
April 20th, 2011 9:47am

Created By & Modified By columns are "Person or Goup" type columns. InSharePoint all the lists has these columns by default. You can't update the values of these columns from UI. But, you can do it through SharePoint APIs. I have created .NET windows based application to update the "created by" and "modified by" columns using SharePoint APIs. I am giving the sample code snippet below. /******** Code snippet for modifying the Created by and Modified by column values of a SharePoint List *******/ /******** Written in .Net Windows Based Application **********/ Sample Code snippet ------------------------------------- string strSite = "<SiteURL>"; string strFilePath = "C:\\test.aspx"; string strFileUrl = "TestDoc5"; SPSite oSite = new SPSite(strSite); SPWeb myWeb = oSite.OpenWeb(); SPFolder objFolder = oSite.OpenWeb().GetFolder("YesNo"); SPFileCollection objFiles = objFolder.Files ; byte[] myFile = new byte[1000]; SPUser myUser = myWeb.AllUsers["domain\\Email"]; FileStream mystream = new System.IO.FileStream(strFilePath ,FileMode.Open ,FileAccess.ReadWrite,FileShare.ReadWrite ); mystream.Read(myFile,0,1000); mystream.Close(); DateTime timeCreated = DateTime.Now.Subtract(new TimeSpan(1000, 0, 0, 0)); DateTime timeModified = DateTime.Now.Subtract(new TimeSpan(990, 0, 0, 0)); SPFile file = objFolder.Files.Add("PavanTest.doc", myFile, myUser, myUser, timeCreated, timeModified); SPListItem item = file.Item; item["Created"] = timeCreated; item["Modified"] = timeModified; file.Item.Update();
July 5th, 2011 5:52am

Bluem1, Do application has any code which access the SPUser token of this user? is this user a system account? Better way to check the versions of items to have idea whether who have updated and when. Regards, Dharnendra Shah "strong belief is the only way to success"
Free Windows Admin Tool Kit Click here and download it now
July 5th, 2011 7:36am

http://blogs.msdn.com/b/sowmyancs/archive/2008/03/14/can-we-update-the-values-of-created-by-modified-by-columns-in-sharepoint-lists.aspx
July 14th, 2011 2:48am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics