One of the features in BatchPatch that many users overlook is the export tool. Admins frequently desire to get BatchPatch grid information into a different format so that it can be consumed by people who are not using BatchPatch, whether it be for reporting or other purposes.
For example, what if you want to prepare a simple report that shows the CPU information for a given list of computers?
- Start by adding the desired hosts to the BatchPatch grid. Then highlight the hosts and perform the desired action, which in this case is ‘Actions > Get information > Get CPU info’ The result should look similar to my screenshot below.
- For this mini-report I only want to include the actual CPU information for each host. I don’t need the information from the ‘All Messages’ column, so I’m going to hide that column by right clicking on the column header and then unchecking the ‘All Messages’ box.
- Now that I am displaying only the information that I’m interested in seeing in the report, I can go ahead and create the export file, which in this example will be an HTML file. Select ‘File > Export grid > Export current grid to HTML file’ and then choose a location to save the output .html file.
- You can now launch your .html report by double-clicking on it and opening it in your default browser. One of the nice things about the HTML export is that it shows the original grid with clickable elements that enable you to click on a field in the grid and immediately jump down to the corresponding location in the report. You can then use the ‘back to table’ option to jump right back to the top of the file. It’s actually a pretty convenient way to display the information, and you can get virtually any kind of information from target computers that you need whether it be a list of installed software or a list of currently logged-on users or a list of last bootup times. Even if BatchPatch does not have a built-in query for the information you desire, it’s simple to write your own query to retrieve custom information. More details on that here: how-to-hard-code-your-own-custom-commands-in-the-batchpatch-actions-menu
- You can also export to a delimited file in case you want to later import the data into a spreadsheet or database. To do this select ‘File > Export grid > Export current grid to delimited file’
- You’ll be prompted to select a custom delimiter. You have to be careful about which delimiter you select. For example, you might think to use the standard comma to create a .csv file. However, commas can appear in BatchPatch grid data, particularly if you are listing titles of Windows Updates. And if a comma appears in the grid data but is also used as a delimiter, you end up with problems with your output file. We usually like to use ‘?’ because it is generally unlikely to appear in grid data. However, you can also specify a custom multi-character delimiter, such as ‘$#$’ or ‘%%^^%%’ or whatever you like.
I have launched the output text file in my default text editor. You can see what that looks like below.
- So now if I want to import my file into a spreadsheet, I can do so very easily using the spreadsheet application’s import feature.