I have recently been building an internal special interest community site, and wanted to prepopulate the site with some postings. The problem is that *I* will be creating the postings on the “Question and Answer” discussion boards, and I wanted to post some questions from other users... so I wanted to impersonate someone and do the posting. For a quick solution, I created the posting, then went into the database and changed the owner of the post. Here's how I did it.
Connect to your content database with the Query tool.
Determine the SiteId and GUID of your posting by title:
select tp_SiteId, tp_GUID, tp_Author, tp_Editor, tp_Created, tp_Modified, nvarchar1, ntext2 from dbo.UserData
where nvarchar1 = 'the title'
Then get a list of users for the SiteId:
select tp_ID, tp_SiteAdmin, tp_Login, tp_Title, tp_Email from dbo.UserInfo
where tp_SiteID = 'EEC6FD27-D497-48AD-2F6D-E9A21FD2EC62'
Update the post with the appropriate user ID for that SiteId:
update dbo.UserData set tp_Author = 2
where tp_GUID = '9FE18320-7273-4AC8-9248-5A581551ED0A'