Thursday, May 17, 2012

How to encapsulate a value in quotes

Many times I get a list of hostnames from someone requesting a software distribution. Rarely are the values in encapsulated with quotes and separated by commas as is required by SCCM's collection query.

Well sometimes all you have to do is ask. Here is a simple Excel formula which will take the hostname value from one cell and encapsulate it in quotes and append a comma.

=CONCATENATE(CHAR(34),A1,CHAR(34),",")

Place the formula in cell A2 where A1 equals the cell with the hostname. Then simply click the bottom right corner of cell A2 and drag it downward the same number of rows as A1. This will create your new values that you can simply copy and paste into your WQL query.

Much Thanks to Jon Scruggs!


No comments:

Post a Comment