Daniel Bryson
Daniel Bryson

Reputation: 11

How To Edit a Lotus Notes Database Entry with Lotus Notes

$outfile = "c:\tools\010422.txt"
#... Set some variables
$strDominoDir = 'acct/FileName.nsf'
$strHubServer = 'ServerName'
$strUserView = 'UseView' 

#... Setup the notes Session connection
$notes = new-object -comobject Lotus.NotesSession
$notes.initialize() 

#... Get a handle on the Domino Directory
$dbNAB = $notes.GetDatabase( $strHubServer, $strDominoDir, 1 ) 
write-Host $dbNAB.Title " : Database Now Open for business" 

#... Get a handle on a View from the Domino Directory
$vwUsers = $dbNAB.GetView( $strUserView ) 
Write-Host $vwUsers.Name " : View Now Open for business" 

$counterF = $vwUsers.GetFirstDocument()
while($CounterF -ne $null){
    $DomNexDocument = $vwUsers.GetNextDocument($CounterF) #Define Next doc                
    Write-Host "$($DomNexDocument.ColumnValues[3]);$($DomNexDocument.ColumnValues[2]);$($DomNexDocument.ColumnValues[10]);$($DomNexDocument.ColumnValues[6])"                
    $CounterF = $DomNexDocument #Raise counter
    add-content $outfile "$($DomNexDocument.ColumnValues[3]);$($DomNexDocument.ColumnValues[2]);$($DomNexDocument.ColumnValues[10]);$($DomNexDocument.ColumnValues[6])"                
}

Good Morning, I have put this code together from various websites in order to be able to connect to a lotus notes database and get the column titles from the database. I seem to be falling flat on my face though when trying to figure out how to use this information to get the actual database entry and modify it. Any help is appreciated. Daniel

Upvotes: 0

Views: 366

Answers (0)

Related Questions