As far as many of you asking how to run some procedure automatically, at night time. Here I have attached a tutorial which explains how to do some Admin actions in batch mode.
Document is also available in Russian language. Please contact me via email if you want to get Russian version.
Procedures menationed in doc are done as exmaple and checked on SAM project. To use it on your project you should review each part espessialy those which contain naming and modify regarding your needs