
BESComputerRemover
Version: 4.0.0.0

Summary:
This command line utility is designed to automate the process of removing computers from the BES Console and deleting the data from the database. The tool breaks up the deletion operations into several categories for more flexibility and options in how data is removed. Some operations simply mark a computer as being deleted in the database. In this way the computer does not appear in the BES Console or Web Reports. However, marking a computer as being deleted does not remove any data from the database and if the computer reports back in, it is restored. The tool also supports the removal of data about computers from the database to free disk space and allow the database to run faster. Computers that have data physically removed from the database will have to send a full refresh report if they report in again. The full refresh report contains all the data from the client and replaces the data that was removed by this tool.

This tool will perform database operations for the following sets of data:

* Removal of Computers by name - accepts a text file with a list of computer names separated by new lines and removes them from the deployment.

* Duplicate Computers - Marks older computers as deleted if a computer exists with the same computer name.

* NotReported Computers - Marks computers as deleted if there are no property results being reported and schedules a full refresh for the computer.

* Expired Computers - Marks computers as deleted if they have not reported in recently.

* Deleted Computers - Physically removes computer data from the database for computers that are already marked as deleted and have not reported in for a long period of time.

Additional Information:

* Batched deletion - Deleting large sets of data causes the SQL transaction log to grow quickly. The log will temporary be larger than the data being removed until the database is shrunk. Batched deletion removes results in sets and pauses between each set, giving you time to shrink and reclaim disk space as you proceed.
Note: Batched deletion is supported only when cleaning up deleted computers



Command Line Arguments
Optional Arguments:
-h : Displays this help message
-? : Displays this help message
-f : Runs in silent mode.  No standard output and script runs automatically to completion.
-l : Sends standard out to logfile created in the directory of this application with name BESComputerRemover.log
-L <Folder> : Specify a folder to create logs in. Do not include a file name.
-u <username> : Used to specify a username for SQL authentication to the database.
-p <password> : Used to specify a password for SQL authentication to the database.
-H <hostname> : Used to specify a hostname for SQL authentication to the database.
-d <port>     : Used to specify a port for SQL authentication to the database.
-C <db name>  : Used to specify the database name.
-A : Run all database cleaning operations.
-D : Mark Duplicate Computers as deleted.
-P <PropertyName> : Use the specified retrieved property to find duplicate computers, like "IP Address".  (Default "Computer Name")
-n : Mark NotReported Computer as deleted.
-N : Specify a text file with computer names to be deleted (One entry for each line).
-e : Mark Expired Computers as deleted.
-t <days>: Specify the number of days after which an Expired Computer will be marked as deleted. (Default 30)
-E : Remove data from the database for Deleted Computers.
-T <days>: Specify the number of inactivity days after which computers marked as deleted will have their data removed. (Default 90)
-c : Do NOT count data before deleting.
-b <batch size> : Performs database deletion operations in batches of this size. The tool will pause between batches until the user presses a key (unless run in silent mode with -f).


Sample calls:
./BESComputerRemover.sh -h
./BESComputerRemover.sh -l
./BESComputerRemover.sh -l -L "/tmp"
./BESComputerRemover.sh -u database_user -p database_password -H database_hostname -d database_port -C database_name
./BESComputerRemover.sh -A -f -l
./BESComputerRemover.sh -A -b 2500000 -l
