OminCompare CLI enables comparisons to be performed via the command-line interface enabling integrations with 3rd party applications such as software deployment software, SQL Server Agent or custom scripts. The information required to perform the comparison and the credentials required to access the servers is stored within the .afd export file, therefore Aireforge Studio will be required to perform any future changes in terms of new servers or comparisons.
OmniCompare CLI is a lightweight application, therefore the comparison file must be created using the main Aireforge Studio application and exported. This exported file contains the servers to check, authentication credentials and the comparisons to perform.
To create the .adc file, select the command line icon at the top right of the comparisons section. You will then be prompted to enter a secure password and the location of the saved file.
We will save this file to d:\tf.adc.
The OmniCompare CLI executable resides in the Aireforge Studio program folder. The argument for the application will be logged out if none are passed in or the help argument (-h) is use.
To perform a trace flag comparison against the servers detailed above we simply pass in the comparison file and password. For the purposes of this tutorial we will enable full logging, although this should be used for debugging only as a lot of information is logged; especially during full comparisons of large estates.
omnicomparecli.exe -i d:\tf.adc -p <password> -v full
As no differences are found, the error code returned is 0.
We will now enable trace flag 1117 on the SQL2014 instance to demonstrate how the application changes. OmniCompare CLI has highlighted the change and returned an error code of 1. This error code could be caught and an alert raised or a deployment aborted.
The information detailed above could be logged to file using the -o command, although a simpler option would be to run the comparison via the Aireforge Studio application.