Today I was working on a simple PowerShell script to update a Date/Time column in SharePoint 2010 – I simply needed to iterate through each list item; updating the value of a column to be today’s date.

As I was doing that, I thought “it sure would be nice if I could preserve the ‘modified by’ person while updating each of these list items.”

Well not only is this possible, but it’s almost too easy!

Here is a screenshot of my list before touching it with PowerShell, two list items – one created by the System Account and one created by me:

What I’m going to do using PowerShell is modify the “Title” of the second list item – the one created by me. However, I’m going to run this code on the server with the farm account.

The key piece is storing the value of the “Modified By” column into a variable so I can then put the value back into the column when I’m done.