Hi All
I have written a JScript (.js) to approve deletion of replicated mail files.
The API ApproveReplicaDeletion() always fails with error “'Invalid Approval Request note.”
Am I doing anything wrong?
Heres the Jscript for Lotus Notes which I am running with its output, Any help is greatly appretiated:
I am running the script with the following command:
cscript.exe ApproveReplicaMailFileDeletion.js CN=tim46w2k3/O=pspl admin4.nsf passpass1
//Command line processing.
var args = WScript.Arguments;
if(args.length != 3)
{
WScript.Echo("Invalid arguments to the Script - Usage: cscript.exe ApproveAdminPDeletions.js <servername> <admin4DBName> <adminIDPassword>");
WScript.Quit(-1);
}
var serverName = args(0);
var adminPDBName = args(1);
var pwd = args(2);
//Create a Notes session.
var session = new ActiveXObject(“Lotus.NotesSession”);
session.initialize(pwd);
var dir = session.GetDbDirectory(serverName);
var admin4DB = dir.OpenDatabase(adminPDBName);
//Approve Replicated Mail File Deletion
WScript.Echo(“----------Approving Replica Mail File Deletion-----------”);
var ProxyActionForDeleteReplicaMailFile = “75”;
var dc1 = admin4DB.FTSearch("FIELD ProxyAction = " + ProxyActionForDeleteReplicaMailFile, 5000);
var docAd41 = dc1.GetFirstDocument();
while(docAd41 != null)
{
var sNoteID2 = docAd41.NoteID;
WScript.Echo("sNoteID2 " + sNoteID2);
try
{
var adminP = session.CreateAdministrationProcess(serverName);
var sNoteID22 = adminP.ApproveReplicaDeletion(sNoteID2);
}
catch(e)
{
WScript.Echo("Approval for Deletion of Replica Mail File FAILED - " + e.description);
}
docAd41 = dc1.GetNextDocument(docAd41);
}
//========================================================================================================
OUTPUT
//========================================================================================================
C:\Scripts>cscript.exe ApproveReplicaMailFileDeletion.js CN=tim46w2k3/O=pspl admin4.nsf passpass1
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
----------Approving Replica Mail File Deletion-----------
sNoteID2 B3A
Approval for Deletion of Replica Mail File FAILED - Invalid Approval Request note.
C:\Scripts>
//========================================================================================================