QUESTION:
How to Bulk Backup/Edit/Restore Device Settings (or other configuration)?
RESOLUTION:
The following are instructions on how to both backup, edit, and restore the rediscovery frequency settings for your devices. This example demonstrates changes with test rediscovery on a device, but can be used more broadly across many other configuration changes. With changes such as these, always use extreme caution and double-check your formulas and results. Please consult with Kaseya Support should there be any questions.
The following are examples done in a Windows Environment, for Linux, please consult the Traverse CLI for modifications:http://traverse.help.kaseya.com/pages/viewpage.action?pageId=1867820
An exhaustive list of the commands may be found in the BVE FlexAPI Developer's Guide at http://help.kaseya.com/webhelp/EN/tv/R8/dev/index.asp#30141.htm
1- In an elevated command prompt, navigate to the utils folder in Traverse
2- Using the bve API, create a backup of all devices and their rediscovery settings using the following command:
bveCLI.pl --host <host> --user <user> --password <password> --exec "device.list" --field devicename,rediscoveryenabled,rediscoveryfrequency --format CSV --output rediscovery-settings-backup.csv
3- Open File in Excel/Open Office and re-organize top columns by removing # so the columns properly align.
4- Sort the data by the rediscovery enabled column, descending:
5- Delete all rows that have rediscovery enabled set to false.
6-Replace all instances of the character "," with blank.
7- Save two instances of this file. One for backup and another for the changes we are going to make.
8-. Insert the following formula in an adjacent clear cell:
=CONCATENATE("device.update ""devicename=";B2;""", ""rediscoveryenabled=true"", ""rediscoveryfrequency=10080"" ")
Note: These functions were performed in Open Office, similar functionality exists in Excel should you choose to use it.
9- Copy/Paste the cell in each row below until you have a formula for every device.
10- Copy the newly created list of device.update commands and save them in a text called enable-rediscovery.txt
11- Return to the command prompt, run the following script to change the settings of the machines:
bveCLI.pl --host <host> --user <user> --password <password> --input "C:\Path\To\Text\File\enable-rediscovery.txt"
12- Confirm the changes have been made:
bveCLI.pl --host <host> --user <user> --password <password> --exec "device.list" --field devicename,rediscoveryenabled,rediscoveryfrequency
13- Once proper analysis has been done, we need to revert the changes. Open the backup save file you made in step 7.
14- Insert the following formula in an adjacent clear cell:
=CONCATENATE("device.update ""devicename=";B2;""", ""rediscoveryenabled=true"", ""rediscoveryfrequency=";D2;""" ")
15- Copy/Paste the cell in the cell below until you have a formula for every device.
16- Copy the newly created list of device.update commands and save them in a text called reset-settings.txt
17- Return to the command prompt, run the following script to change the settings of the machines:
bveCLI.pl --host <host> --user <user> --password <password> --input "C:\Path\To\Text\File\reset-settings.txt"
18- Confirm the changes have been made:
bveCLI.pl --host <host> --user <user> --password <password> --exec "device.list" --field devicename,rediscoveryenabled,rediscoveryfrequency