cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Managing Repository Transactions

Solved
Occasional Contributor

Managing Repository Transactions

My company peforms weekly maintenance. This consists of several steps, but I am bring up only one, the deleting repository transactions (all users are removed and blocked from access during this step).  At this moment you have to confirm each individual transaction for deletion. Is there a script that can delete all these transcations without individual confirmation needed?

4 Replies
MEGA

Re: Managing Repository Transactions

Hello,

 

you can use a script like this one :

 

sAdmUser = "Administrator"
sAdmPwd = ""
sEnvPath = "C:\Program Files\MEGA 2009 SP5\Standard"

Set oMegaApp = CreateObject("Mega.Application")
Set oEnvironment=oMegaApp.Environments.item(sEnvPath)
oEnvironment.CurrentAdministrator = sAdmUser
oEnvironment.CurrentPassword = sAdmPwd

Set oTransactions = oEnvironment.Transactions

For Each oTran in oTransactions
  oTran.Abort
Next

Set oTransactions =  Nothing

 

Of course you need to use correct admin user, password, and environment path ;-)

 

Regards,

 

Lionel

Occasional Contributor

Re: Managing Repository Transactions

Hi,

 

A full script is given in MEGA 2009 SP5/Samples/API/ under the name of Sample_AbortTransactions.vbs

 

I have tested the piece of code of Lionel and the one given in API folder, unfortunately none of them works with me.

The script failed when setting the administrator name (line 49).

The VB error message is:  Object required.

 

I do not understand why I have this message:

- I have checked the administrator account. For me it is correct: I use the default "Administrator" account with my own password that I have set to this account (it works perfectly if I launch MEGA Admin)

- I thought that it was due to the set of MyEnv. The path for the environment is correct.

- I thought that i was due to the level of Windows Notifications when we launch an executable; I have deactivated the Windows notifications and unfortunately I still have the error.

 

Any idea ?

Thank you

MEGA

Re: Managing Repository Transactions

Hello Emmanuel,

 

to have this script working, you must of course run it on a computer where MEGA is correctly installed.

Try to re-register MEGA in you registry : KB00000098

 

Check also between "Administrator" and "Administrateur"... it's easy to be mistaking :-)

 

Lionel

Occasional Contributor

Re: Managing Repository Transactions

Thank you Lionel for your amswer.

 

I have solved my issue.

 

The problem was not coming from the registry or the administor account but the way of writing the path of the environment.

 

I launched the script on the server directly with writing the path like:  C:\Program......

But we are currently using MEGA as client-Server configuration and due to this configuration all paths of environments are written in MEGA Admin like:  \\{ServerName}\{SharedEnvironmentFolder}\{EnvironmentName}

When I launched the VB script, the path C:\Program..... did not matched with the path \\xxxx....... given in MEGA Admin even if the location reached is the same.

 

Conclusion: we have to use exactly the same path written in MEGA Admin. It seems obvious after all but.... Smiley Wink 

 

Emmanuel