Ask the Community
Groups
Tip: How to Bulk Backup/Edit/Restore Device Settings (or other configuration) - Connect IT Community | Kaseya
<main> <article class="userContent"> <p><strong>QUESTION:</strong></p> <p>How to Bulk Backup/Edit/Restore Device Settings (or other configuration)?</p> <p> </p> <p><strong>RESOLUTION:</strong></p> <p>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.</p> <p>The following are examples done in a Windows Environment, for Linux, please consult the Traverse CLI for modifications:<a href="/home/leaving?allowTrusted=1&target=http%3A%2F%2Ftraverse.help.kaseya.com%2Fpages%2Fviewpage.action%3FpageId%3D1867820" rel="noopener nofollow">http://traverse.help.kaseya.com/pages/viewpage.action?pageId=1867820</a></p> <p>An exhaustive list of the commands may be found in the BVE FlexAPI Developer's Guide at <a href="/home/leaving?allowTrusted=1&target=http%3A%2F%2Fhelp.kaseya.com%2Fwebhelp%2FEN%2Ftv%2FR8%2Fdev%2Findex.asp%2330141.htm">http://help.kaseya.com/webhelp/EN/tv/R8/dev/index.asp#30141.htm</a></p> <p>1- In an elevated command prompt, navigate to the utils folder in Traverse </p> <p><br><img src="/attachments/token/HPBQyHbrw5U5xisyYWa6pYGZA/?name=cd-to-utils.PNG" alt="" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p>2- Using the bve API, create a backup of all devices and their rediscovery settings using the following command:</p> <pre class="code codeBlock" spellcheck="false" tabindex="0">bveCLI.pl --host <host> --user <user> --password <password> --exec "device.list" --field devicename,rediscoveryenabled,rediscoveryfrequency --format CSV --output rediscovery-settings-backup.csv </pre> <p> </p> <p><img src="/attachments/token/PqObw4SlLUfQwVRpV22BjKFIm/?name=output-list.PNG" alt="" width="1087" height="613" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p>3- Open File in Excel/Open Office and re-organize top columns by removing # so the columns properly align.</p> <p>4- Sort the data by the rediscovery enabled column, descending:</p> <p> </p> <p><img src="/attachments/token/rsodK2LrMwnIHIG7xzGInD6as/?name=excel-sort-data.PNG" alt="" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p>5- Delete all rows that have rediscovery enabled set to false.</p> <p>6-Replace all instances of the character "," with blank.</p> <p> </p> <p><img src="/attachments/token/TpPQrqJF37Jbt2tFpuDIO4oCi/?name=excel-remove-commas.PNG" alt="" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p>7- Save two instances of this file. One for backup and another for the changes we are going to make.</p> <p>8-. Insert the following formula in an adjacent clear cell:</p> <p> </p> <pre class="code codeBlock" spellcheck="false" tabindex="0">=CONCATENATE("device.update ""devicename=";B2;""", ""rediscoveryenabled=true"", ""rediscoveryfrequency=10080"" ") </pre> <p> </p> <p><img src="/attachments/token/tVg3tCL30UnGZADfAkkRoAjTg/?name=excel-original-settings-formula.PNG" alt="" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p>Note: These functions were performed in Open Office, similar functionality exists in Excel should you choose to use it.</p> <p>9- Copy/Paste the cell in each row below until you have a formula for every device.</p> <p>10- Copy the newly created list of device.update commands and save them in a text called enable-rediscovery.txt</p> <p> </p> <p><img src="/attachments/token/5UQZbRqZJEZ3m9Ju7MfJsHLey/?name=save-formulas-to-files.PNG" alt="" width="1096" height="589" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p>11- Return to the command prompt, run the following script to change the settings of the machines:</p> <pre class="code codeBlock" spellcheck="false" tabindex="0">bveCLI.pl --host <host> --user <user> --password <password> --input "C:\Path\To\Text\File\enable-rediscovery.txt" </pre> <p> </p> <p><img src="/attachments/token/d5yyfaoArHbxw6usn7ZyOYM1Z/?name=change-settings-via-input.PNG" alt="" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p>12- Confirm the changes have been made:</p> <p> </p> <pre class="code codeBlock" spellcheck="false" tabindex="0">bveCLI.pl --host <host> --user <user> --password <password> --exec "device.list" --field devicename,rediscoveryenabled,rediscoveryfrequency </pre> <p> </p> <p><img src="/attachments/token/tJmMmmagyjxNiPh3eReFFwGan/?name=new-settings.PNG" alt="" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p>13- Once proper analysis has been done, we need to revert the changes. Open the backup save file you made in step 7.</p> <p>14- Insert the following formula in an adjacent clear cell:</p> <p> </p> <pre class="code codeBlock" spellcheck="false" tabindex="0">=CONCATENATE("device.update ""devicename=";B2;""", ""rediscoveryenabled=true"", ""rediscoveryfrequency=";D2;""" ") </pre> <p> </p> <p><img src="/attachments/token/0gtepZRDDLepwbxL1YZuT1ao2/?name=excel-new-settings-formula.PNG" alt="" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p>15- Copy/Paste the cell in the cell below until you have a formula for every device.</p> <p>16- Copy the newly created list of device.update commands and save them in a text called reset-settings.txt</p> <p>17- Return to the command prompt, run the following script to change the settings of the machines:</p> <p> </p> <pre class="code codeBlock" spellcheck="false" tabindex="0">bveCLI.pl --host <host> --user <user> --password <password> --input "C:\Path\To\Text\File\reset-settings.txt" </pre> <p> </p> <p>18- Confirm the changes have been made:</p> <p> </p> <pre class="code codeBlock" spellcheck="false" tabindex="0">bveCLI.pl --host <host> --user <user> --password <password> --exec "device.list" --field devicename,rediscoveryenabled,rediscoveryfrequency</pre> <p> </p> </article> </main>