Howto rename Lotus Notes field by using PowerShell

You need to have Lotus Notes client installed on your machine. Then you need to run PowerShell (x86).

$lns = New-Object -ComObject Lotus.NotesSession
$lns.Initialize()
$db= $lns.GetDatabase('','YOUR_DB_NAME')

$doc = $db.GetDocumentByUNID('1E733555DDB27DA785257D7E005E64B0')
$doc.RemoveItem('TARGET_FIELD_NAME')
$doc.CopyItem($doc.GetFirstItem('SOURCE_FIELD_NAME'),'TARGET_FIELD_NAME')
$doc.RemoveItem('SOURCE_FIELD_NAME')
$doc.Save($false, $true)
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s