About This Code
Brief Description:
Send Console Commands from LotusScript
Contributor:
Andrew Jones
Last Modified:
17 Jun 2002
OpenNTF Disclaimer
All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.
Code / Description
Howard Helbein
28 Dec 2000, Rating 4.00 (out of 5)
This code shows how to send a console command to a Lotus Notes server from Lotus Script using the NSFRemoteConsole function from the C API. The user ID that this runs under needs remote console access which is granted in the Administrator field of the server document. In my example, I force the AdminP process on a server to process all requests, but this can be useful to force replication, logging of statistics, etc
Usage / Example
Declare Function NSFRemoteConsole Lib "nnotes.dll" (Byval ServerName As String, Byval ConsoleCommand As String, rethBuffer As Long) As Integer
Sub SendConCMD
Dim api_res As Integer
Dim hBuf As Long
'Send the console command TELL ADMINP PROCESS ALL to server SALES01
api_res = NSFRemoteConsole("SALES01", "TELL ADMINP PROCESS ALL", hBuf)
End Sub
Comments
Posted by John Smart on 12/26/2006 04:16:44 PMSince ND6, use NotesSession.SendConsoleCommand instead.
New as of ND6 is the NotesSession.SendConsoleCommand which does the same thing.