So I know Lotuscript is available for pretty much anything in Notes & Domino, but we now have Powershell which can be easier to use than Lotuscript.
So here’s how I hooked into a Notes Session using powershell to perform some tasks recently..
Clear-Host #... Set some variables $strDominoDir = 'names.nsf' $strHubServer = 'SERVER1/SVR/LONDON/ORG' $strUserView = '($Users)' #... 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" #... Find a document by string key and access user attributes $docUser = $vwUsers.GetDocumentByKey( "John Smith" ) Write-Host $docUser.GetItemValue( "mailfile" )
Whats really cool about this is that you can pretty much use Lotuscript calls in much the same way you would normally. This reduces the amount of new code you have to write.
This method is similar to the way a Notes session is started in VBA.
What did I use this for? As part of our Notes upgrade to 8.5..
I piped in all of my users Windows ID’s as the Key in the GetDocumentByKey Command, which in turn returned their mail file paths then added them to an .IND file.
This was then copied to the domino Servers ready to run the Load Convert Task, amongst other actions !