Grouping data returned via WMI

Hi All,

Pretty new to TEM, so expect this to be rather simple for experienced TEM admins. I am looking to write an analysis that uses WMI to return the logged on user as well as any mapped logical disks. For mapped logical disks the logical disk letter and network path are returned independently and I would like to group them into one string value. Something along the lines of;

LoggedOnUser
Joe.Bloggs

MappedDrives
P:\path\to\drive

The following is what I am using in my MappedDrives property. Any assistance with the syntax I need to add to be able to group the name and providername values together would be greatly appreciated.

if (exists wmi) then (string values of selects "name, providername from win32_mappedlogicaldisk" of wmi) else ("N/A")

Hi Nicoloks, and welcome.

I believe this should achieve what you are looking for:

if (exists wmi) then ((string value of property "name" of it & " " & string value of property "providername" of it) of select objects "name,providername from win32_mappedlogicaldisk" of wmi) else ("N/A")

Explanation:

1 Like

Great, thanks. That did the trick!

If you make WMI plural, then you don’t need to check that WMI exists first:

(string value of property "name" of it & " " & string value of property "providername" of it) of select objects "name,providername from win32_mappedlogicaldisk" of wmis
1 Like