It

(imported topic written by SystemAdmin)

I couldn’t think of a good subject, but it deals with it more than anything else, so it is it.

I’m trying to make relevance similar to this work correctly:

(name of key it of registry) of (names of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel” of registry) as string

Before you jump on that and say, “You’ve overcomplicated it. Do it this way”…

names of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel” of registry

Rest assured that this is only for illustrative purposes and it would take far too much typing (and i’m lazy) to fully explain the real situation.

Basically I want to take a set of strings and use them as a reference to a registry key, but do other things with the string so I need it to be in the “(…) of” part. If I change “(name of key it of registry)” to “(it)”, I get the proper list of strings. I’m sure there’s a good reason that “(name of key it of registry)” doesn’t work, but I’m hoping with some changes it can get it to do what I need…

Any helpful suggestions? :slight_smile:

Thanks in advance!

Jim

(imported comment written by brolly3391)

Hello Jim,

IT is the second most challenging keyword in relevance. Only Tuples (,) are harder.

You had 2 different issues. The first and easiest was that you were not appending the rest of the path to the key to the name. Sort of like getting a file name and treating it as if it were a pathname. The second is much tricker. Essentially the OF in your IT clause is taking over the IT. IT refers to the object(s) to the right of the preceding OF. Maybe I can demonstrate better than I can explain.

q: (file

IT

)

of

(+“c:\boot.ini”;“c:\config.sys”+)

A: “boot.ini” “” “” “” “”

A: “config.sys” “” “” “” “”

IT

refers to the

list of strings

.

q: (file

IT

of

+folder “c:”+) of (“boot.ini”;“config.sys”)

E: The operator “file” is not defined.

IT

refers to the

folder object “c:”

.

Lets move that list of strings inside instead of outside.

q: files (“boot.ini”;“config.sys”) of folder “c:”

A: “boot.ini” “” “” “” “”

A: “config.sys” “” “” “” “”

This is a workaround that did not actually use IT.

To apply this to your relevance:

q: (“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel” & it ) of names of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel” of registry

A: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cpls

A: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Cursors

A: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\don’t load

A: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Extended Properties

A: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel\Settings

gives us our list of strings.

names of keys (+list of strings here+) of registry

q: names of keys (( “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel” & it ) of names of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Control Panel” of registry) of registry

A: Cpls

A: Cursors

A: don’t load

A: Extended Properties

A: Settings

If you need help with your big-ugly relevance, post it and we will brainstorm with you.

Cheers,

Brolly

(imported comment written by SystemAdmin)

Thank you Brolly. My example wasn’t quite right, so the first issue was just due to my choice in example.

Your explanation of the main issue makes sense now, even if I don’t like it. :slight_smile:

The main reason I was trying to do this is because I get the registry path along with another piece of data in the same string. So I wanted to be able to pull out the first part of the string (the reg key path) and use it to retrieve a value of that key along with the 2nd part of the original string. For example:

(
(
preceding text of first “||” of it
)
& “||” &
(
following text of first “||” of it
)
)
of
(
(
“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” & name of it & “||somethingelse”
)
of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry
)

returns

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ActiveTouchMeetingClient||somethingelse
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AddressBook||somethingelse
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AdobeESD||somethingelse
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\All ATI Software||somethingelse

So instead of just “preceding text of first “||” of it”, I want to grab the value “DisplayName” of the given key path,

and

the “somethingelse” that went along with the key path and return both.

I appreciate any ideas you might have on how to accomplish that. I’m trying to avoid dropping a vbscript on the machines and just use relevance…

Thanks,

Jim

(imported comment written by brolly3391)

Hey Jim,

q: (“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” & name of it, values “DisplayName” of it, “something else”) of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry

A: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ActiveTouchMeetingClient, WebEx, something else

A: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Atmosphere Player, Adobe Atmosphere Player for Acrobat and Adobe Reader, something else

A: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\All ATI Software, ATI - Software Uninstall Utility, something else

.

.

.

Is your “Something else” another part of the registry or something unrelated? If it is related to the registry key we can just drill down from our object, which is still a registry key at that point. If it is unrelated then just drop your code in where “something else” occurs. Welcome to tuples level one.

Cheers,

Brolly

(imported comment written by SystemAdmin)

The inner registry pull was just to get the a sample list of strings, but I’m really getting the strings out of WMI. Here’s what I’ve got so far:

(
(
preceding text of first “||” of it
)
& “{|}” &
(
preceding text of first “||” of following text of first “||” of it
)
& “{|}” &
(
following text of last “||” of it
)
)
of
(
(
"HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port " &
(
substring after “=” of
(
Property “SCSIPort” of it as string
)
)
& "\Scsi Bus " &
(
substring after “=” of
(
Property “SCSIBus” of it as string
)
)
& "\Target Id " &
(
substring after “=” of
(
Property “SCSITargetID” of it as string
)
)
& "\Logical Unit Id " &
(
substring after “=” of
(
Property “SCSILogicalUnit” of it as string
)
)
& “||” &
(
If
(
Property “Size” of it as string
)
contains "="
Then
(
Following text of last “=” of
(
Property “Size” of it as string
)
as floating point / 1024 / 1024 / 1024
)
as string
else
(
“0”
)
)
& “||” &
(
following text of last “PHYSICALDRIVE” of
(
Property “DeviceID” of it as string
)
)
)
of select objects “Caption, DeviceID, InterfaceType, Model, Name, SCSIPort, SCSIBus, SCSITargetID, SCSILogicalUnit, Size FROM Win32_DiskDrive” of wmi
)

which returns the reg path i need to get the “Identifier” value for each plus the size and physical drive id #

HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0{|}.99585056{|}11
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 1{|}7.798275948{|}12
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 4\Scsi Bus 4\Target Id 0\Logical Unit Id 0{|}16.944780350{|}0
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0{|}.03830194{|}3
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 246{|}16.8528557{|}5
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 245{|}8.4264278{|}4
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0{|}4.994573593{|}6
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 1{|}309.992959499{|}7
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 2{|}4.994573593{|}8
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5\Scsi Bus 0\Target Id 0\Logical Unit Id 0{|}4.994573593{|}1
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 1{|}.99585056{|}10
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0{|}13.995530605{|}9
HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 5\Scsi Bus 0\Target Id 3\Logical Unit Id 0{|}19.173953533{|}2

I want to get Value “Identifier” of the given key and return it along with the size and physical drive wmi properties (the two concatenated values) that are related.

To make matters ‘worse’, I need to cross-reference the physical drive number to get the corresponding logical volume names:

(
preceding text of first “,” of following text of first “#” of
(
Property “Antecedent” of it as string
)
& “|” & preceding text of last “:” of following text of first “%22” of
(
Property “Dependent” of it as string
)
& “:”
)
of select objects “* from Win32_LogicalDiskToPartition” of wmi

which returns

0|C:
7|D:
9|G:
2|I:
6|J:
1|K:
11|L:
12|M:
4|O:
10|U:
5|X:

so ultimately I want “||”.

I’m not asking you to do all this for me, but again any pointers would be helpful. Worst case I can still plop it all in vbscript and be done with it.

Thanks,

Jim

(imported comment written by SystemAdmin)

Just for reference, here it is working in VBscript…

Option Explicit On Error GoTo 0   Dim wmiServices Dim wmiDiskDrives Dim wmiDiskDrive Dim wmiDiskPartitions Dim wmiDiskPartition Dim wmiLogicalDisks Dim wmiLogicalDisk Dim WshShell Dim Identifier   
' Get the shell Set WshShell = WScript.CreateObject(
"WScript.Shell") 
' Get WMI Set wmiServices = GetObject(
"winmgmts:{impersonationLevel=Impersonate}!//.") 
' Get physical disk drive Set wmiDiskDrives = wmiServices.ExecQuery(
"SELECT Caption, DeviceID, InterfaceType, Model, Name, SCSIPort, SCSIBus, SCSITargetID, SCSILogicalUnit, Size FROM Win32_DiskDrive") 
' Run through the drives For Each wmiDiskDrive In wmiDiskDrives 
' Pull the device identifier out of the registry Identifier = WshShell.RegRead(
"HKEY_LOCAL_MACHINE\HARDWARE\DeviceMap\Scsi" & _ 
"\Scsi Port " & wmiDiskDrive.SCSIPort & 
"\Scsi Bus " & wmiDiskDrive.SCSIBus & _ 
"\Target Id " & wmiDiskDrive.SCSITargetID & 
"\Logical Unit Id " & wmiDiskDrive.ScsiLogicalUnit & 
"\Identifier") 
' Get the disk's partitions Set wmiDiskPartitions = wmiServices.ExecQuery(
"ASSOCIATORS OF {Win32_DiskDrive.DeviceID='" & wmiDiskDrive.DeviceID & _ 
"'} WHERE AssocClass = Win32_DiskDriveToDiskPartition") 
' Run through the partitions For Each wmiDiskPartition In wmiDiskPartitions 
' Use partition device id to find logical disk Set wmiLogicalDisks = wmiServices.ExecQuery (
"ASSOCIATORS OF {Win32_DiskPartition.DeviceID='" & _ wmiDiskPartition.DeviceID & 
"'} WHERE AssocClass = Win32_LogicalDiskToPartition") 
' Run through the logical disks For Each wmiLogicalDisk In wmiLogicalDisks 
' Put it all together  Identifier | Disk size | Logical drive letter | Logical drive size WScript.Echo Identifier & 
"|" & Round(wmiDiskDrive.Size / 1024 / 1024 / 1024, 2) & 
"|" & wmiLogicalDisk.DeviceID & 
"|" & Round(wmiLogicalDisk.Size / 1024 / 1024 / 1024, 2) Next Next Next

which returns

STK     OPENstorage D2800612|1|L:|1 STK     OPENstorage D2800612|7.8|M:|7.8 DELL    Container|16.94|C:|16.91 EMC     SYMMETRIX       5671|16.85|X:|16.85 EMC     SYMMETRIX       5671|8.43|O:|8.43 DGC     RAID 5          0216|4.99|J:|4.99 DGC     RAID 5          0216|309.99|D:|309.99 DGC     RAID 5          0216|4.99|K:|4.99 DGC     RAID 5          0219|1|U:|1 DGC     RAID 5          0219|14|G:|14 DGC     RAID 5          0207|19.17|I:|19.17

I did change a little from my previous post where this returns the physical disk size and then the logical volume size…

(imported comment written by brolly3391)

Hey there Jim,

Now we are getting to the good stuff! I have seen something like this before somewhere here on the forums I think.

http://forum.bigfix.com/viewtopic.php?id=775

Just for my own benefit, I think you want:

(A) Drive Identifier | (B) Total capacity of physical drive in GB| © Partitions on drive (by drive letter) | (D) Size of partition in GB

And your current sources for this data are:

Registry call | WMI | WMI | WMI

I notice in the output from your VB that field B and D match on every entry except one. This leads me to believe that field B is not really giving you total drive capacity. Is that coincidence or an oops?

I think the secret will be in pulling all the registry keys "HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port " in a tuple and then perform matching to the WMI calls using some WHOSE instead of trying to look up reg keys based on the strings returned from WMI but I am not sure yet. I am still kicking this one around in my head.

Cheers,

Brolly

(imported comment written by SystemAdmin)

Yes, it’s a follow-on to that. I hadn’t had time to work on it until now and was thinking around the problem a bit. Most of the disks and volumes are the same here because it is on a SAN and has one volume per ‘disk’. It’s not always the case so I went ahead and added both in my vbscripot.

I can see you’re like me and can’t let something like this go. I’ve gone ahead with deploying the vbscript for the time being, but I would love to see it in relevance… :slight_smile:

Thanks,

Jim

(imported comment written by brolly3391)

Hello Jim,

First note that I have a single partition on physical IDE drive, an empty DVD ROM drive and a USB drive in my system right now.

I use a nested tuple to get the full key name of each entry under HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi. I pick up the name of each key as we drill down.

q: ((“HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi” & name of it , (names of keys of it , (names of keys whose (name of it starts with “Target Id”) of keys of it, (names of keys of keys of keys of it, (value “Identifier” of keys of keys of keys of it as string)))) ) of keys of key “HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi” of registry)
A: HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\ScsiScsi Port 0, ( Scsi Bus 0, ( Target Id 0, ( Logical Unit Id 0, Hitachi HTS721080G9AT00 ) ) )
A: HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\ScsiScsi Port 1, ( Scsi Bus 0, ( Target Id 0, ( Logical Unit Id 0, PHILIPS DVD±RW SDVD8820 ) ) )

Then I pull each item out of the tuple to generate a string that includes each key name from the registry information in one string in such a way that I can parse items out of it later. I also stick the value we will need on the end of that. This will function as a lookup pair later. This sort of thing makes be wish for a new Registry Key property: pathname of key “…” of registry or keypath of key “…” of registry

q: (item 0 of it & “” & item 0 of item 1 of it & “” & item 0 of item 1 of item 1 of it &"" & item 0 of item 1 of item 1 of item 1 of it & “||” & item 1 of item 1 of item 1 of item 1 of it) of ((“HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi” & name of it , (names of keys of it , (names of keys whose (name of it starts with “Target Id”) of keys of it, (names of keys of keys whose (name of it starts with “Target Id”)of keys of it, (value “Identifier” of keys of keys whose (name of it starts with “Target Id”)of keys of it as string)))) ) of keys of key “HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi” of registry)
A: HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 0\Scsi Bus 0\Target Id 0\Logical Unit Id 0||Hitachi HTS721080G9AT00
A: HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 1\Scsi Bus 0\Target Id 0\Logical Unit Id 0||PHILIPS DVD±RW SDVD8820

So the first phrase is done. Put that one aside and pull the WMI info out as 2 separate phrases. The empty result comes from the USB drive.

q: (if (exists string values of properties(“SCSIPort”;“SCSIBus”;“SCSITargetID”;“SCSILogicalUnit”) of it) then (“HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port " & string value of Property “SCSIPort” of it & “\Scsi Bus " & string value of Property “SCSIBus” of it &”\Target Id " &string value of Property “SCSITargetID” of it&”\Logical Unit Id “&string value of Property “SCSIBus” of it&”||"& following text of first “PHYSICALDRIVE” of string value of property “DeviceID” of it &"||"& (string value of property “size” of it as integer/(102410241024)) as string ) else ("||")) of select objects “Caption, DeviceID, InterfaceType, Model, Name, SCSIPort, SCSIBus, SCSITargetID, SCSILogicalUnit, Size FROM Win32_DiskDrive” of wmi
A: HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 0\Scsi Bus 0\Target Id 0\Logical Unit Id 0||0||74
A: ||

So that is the first WMI query. Put that phrase aside and move on to the final WMI query.

q: (string value of property “Antecedent” of it & “||” & string value of property “Dependent” of it) of select objects “Antecedent,Dependent from Win32_LogicalDiskToPartition” of wmi
A: \FREEBIRD\root\cimv2:Win32_DiskPartition.DeviceID=“Disk #0, Partition #0”||\FREEBIRD\root\cimv2:Win32_LogicalDisk.DeviceID="C:"
A: \FREEBIRD\root\cimv2:Win32_DiskPartition.DeviceID=“Disk #1, Partition #0”||\FREEBIRD\root\cimv2:Win32_LogicalDisk.DeviceID=“E:”

Let us get just the pieces of info we need from that query. Notice the call to pull drive space by drive letter. Also notice the order I put them in the same order as tehy will appear in the final result, saving a step later.

q: ( first 1 of following text of last “Disk #” of string value of property “Antecedent” of it & “||”& (it & “||” & (total space of drive it/(102410241024)) as string) of first 2 of following text of last “=%22” of string value of property “Dependent” of it ) of select objects “Antecedent,Dependent from Win32_LogicalDiskToPartition” of wmi
A: 0||C:||74
A: 1||E:||0

So we have all the items we want to have in our final result and some lookup information with each one so that we can match things up in our final Tuple. Tuple all 3 pieces together, the Registry dump, the first WMI call and the second WMI call and add our filter at the very end. You should take a look at the results without the filter as well (remove WHOSE and everything that follows). That huge tuple is every possible combination of each of the 3 table entries.

q: ((item 0 of it & “” & item 0 of item 1 of it & “” & item 0 of item 1 of item 1 of it &"" & item 0 of item 1 of item 1 of item 1 of it & “||” & item 1 of item 1 of item 1 of item 1 of it) of ((“HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi” & name of it, (names of keys of it , (names of keys whose (name of it starts with “Target Id”) of keys of it, (names of keys of keys whose (name of it starts with “Target Id”)of keys of it, (value “Identifier” of keys of keys whose (name of it starts with “Target Id”)of keys of it as string)))) ) of keys of key “HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi” of registry), (if (exists string values of properties(“SCSIPort”;“SCSIBus”;“SCSITargetID”;“SCSILogicalUnit”) of it) then (“HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port " & string value of Property “SCSIPort” of it & “\Scsi Bus " & string value of Property “SCSIBus” of it &”\Target Id " &string value of Property “SCSITargetID” of it&”\Logical Unit Id “&string value of Property “SCSIBus” of it&”||"& following text of first “PHYSICALDRIVE” of string value of property “DeviceID” of it &"||"& (string value of property “size” of it as integer/(102410241024)) as string ) else ("||")) of select objects “Caption, DeviceID, InterfaceType, Model, Name, SCSIPort, SCSIBus, SCSITargetID, SCSILogicalUnit, Size FROM Win32_DiskDrive” of wmi, ( first 1 of following text of last “Disk #” of string value of property “Antecedent” of it & “||”& (it & “||” & (total space of drive it/(102410241024)) as string) of first 2 of following text of last “=%22” of string value of property “Dependent” of it ) of select objects “Antecedent,Dependent from Win32_LogicalDiskToPartition” of wmi) WHOSE (preceding text of first “||” of item 0 of it as lowercase = preceding text of first “||” of item 1 of it as lowercase AND substring between “||” of item 1 of it = first 1 of item 2 of it)
A: HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 0\Scsi Bus 0\Target Id 0\Logical Unit Id 0||Hitachi HTS721080G9AT00, HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 0\Scsi Bus 0\Target Id 0\Logical Unit Id 0||0||74, 0||C:||74

Now we just format that resultant string to get the formatting you wanted.

q: (following text of last “||” of item 0 of it & “||” & following text of last “||” of item 1 of it & “||” & following text of first “||” of item 2 of it) of ((item 0 of it & “” & item 0 of item 1 of it & “” & item 0 of item 1 of item 1 of it &"" & item 0 of item 1 of item 1 of item 1 of it & “||” & item 1 of item 1 of item 1 of item 1 of it) of ((“HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi” & name of it, (names of keys of it , (names of keys whose (name of it starts with “Target Id”) of keys of it, (names of keys of keys whose (name of it starts with “Target Id”)of keys of it, (value “Identifier” of keys of keys whose (name of it starts with “Target Id”)of keys of it as string)))) ) of keys of key “HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi” of registry), (if (exists string values of properties(“SCSIPort”;“SCSIBus”;“SCSITargetID”;“SCSILogicalUnit”) of it) then (“HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port " & string value of Property “SCSIPort” of it & “\Scsi Bus " & string value of Property “SCSIBus” of it &”\Target Id " &string value of Property “SCSITargetID” of it&”\Logical Unit Id “&string value of Property “SCSIBus” of it&”||"& following text of first “PHYSICALDRIVE” of string value of property “DeviceID” of it &"||"& (string value of property “size” of it as integer/(102410241024)) as string ) else ("||")) of select objects “Caption, DeviceID, InterfaceType, Model, Name, SCSIPort, SCSIBus, SCSITargetID, SCSILogicalUnit, Size FROM Win32_DiskDrive” of wmi, ( first 1 of following text of last “Disk #” of string value of property “Antecedent” of it & “||”& (it & “||” & (total space of drive it/(102410241024)) as string) of first 2 of following text of last “=%22” of string value of property “Dependent” of it ) of select objects “Antecedent,Dependent from Win32_LogicalDiskToPartition” of wmi) WHOSE (preceding text of first “||” of item 0 of it as lowercase = preceding text of first “||” of item 1 of it as lowercase AND substring between “||” of item 1 of it = first 1 of item 2 of it)
A: Hitachi HTS721080G9AT00||74||C:||74
T: 639.293 ms
I: plural string

Done. So to review, instead of trying to take a list of strings change them into registry keys, which we discovered does not always work the way we want it to, we dumped everything from the registry and 2 wmi queries and stuck it together as a giant wad of mixed information inside a tuple. We made sure that each discrete bit in our big wad had some information that we could use to correlate it to the other 2 bits. Then we filtered our wad of mixed information to only show the items where certain pieces matched up. This got rid of all the entries in our tuple where the information did not match up. I like to think of it like 3 tables in a relational DB and then creating some joins between them.

I think this relevance should do the trick for you. There may be some error points that I did not catch along the way so let me know how it works out. RAID arrays and stripe sets spring to mind as possible issues as well.

I should also add that this is hugely inefficient due largely to the WMI calls being painfully slow but also to the fact that we will have roughly ((# of drives) ^2) * (total # of partitions)) items in our final tuple before we filter it.

Can anyone improve on this approach? Is there a faster/better way to do this that I have overlooked?

Cheers,

Brolly

(imported comment written by SystemAdmin)

Hi Brolly, I didn’t mean to leave you hanging, but duty calls. I tested it right after you posted and ran into a singular/plural issue (Error: Singular expression refers to non-unique object.). I was under a deadline, so I ended up dropping the vbscript on the systems to get the data I needed right away.

Unfortunately, I haven’t had time to dig in and figure out the specific line, althought I have a feeling it’s related to the 2nd tuple. I’ve extracted the individual result sets from each tuple along with the wmi results in case it helps.

HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 0, ( Scsi Bus 0, ( Target Id 0, ( Logical Unit Id 0, SAMSUNG CD-ROM SN-124 ) ) ) HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\Scsi Port 4, ( Scsi Bus 0, ( Target Id 0, ( Logical Unit Id 0, DELL    Container%00%00%00%00%00%00%00V1.0 ) ) )     HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||11||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||12||7 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 4\Scsi Bus 4\Target Id 0\Logical Unit Id 4||0||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||3||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||5||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||4||8 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||6||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||7||309 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||8||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 0\Logical Unit Id 0||1||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||10||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||9||13 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 3\Logical Unit Id 0||2||19     HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||11||0, 0||C:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||11||0, 7||D:||309 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||11||0, 9||G:||13 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||11||0, 2||I:||19 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||11||0, 6||J:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||11||0, 1||K:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||11||0, 1||L:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||11||0, 1||M:||7 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||11||0, 4||O:||8 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||11||0, 1||U:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||11||0, 5||X:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||12||7, 0||C:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||12||7, 7||D:||309 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||12||7, 9||G:||13 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||12||7, 2||I:||19 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||12||7, 6||J:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||12||7, 1||K:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||12||7, 1||L:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||12||7, 1||M:||7 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||12||7, 4||O:||8 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||12||7, 1||U:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 1\Logical Unit Id 0||12||7, 5||X:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 4\Scsi Bus 4\Target Id 0\Logical Unit Id 4||0||16, 0||C:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 4\Scsi Bus 4\Target Id 0\Logical Unit Id 4||0||16, 7||D:||309 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 4\Scsi Bus 4\Target Id 0\Logical Unit Id 4||0||16, 9||G:||13 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 4\Scsi Bus 4\Target Id 0\Logical Unit Id 4||0||16, 2||I:||19 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 4\Scsi Bus 4\Target Id 0\Logical Unit Id 4||0||16, 6||J:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 4\Scsi Bus 4\Target Id 0\Logical Unit Id 4||0||16, 1||K:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 4\Scsi Bus 4\Target Id 0\Logical Unit Id 4||0||16, 1||L:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 4\Scsi Bus 4\Target Id 0\Logical Unit Id 4||0||16, 1||M:||7 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 4\Scsi Bus 4\Target Id 0\Logical Unit Id 4||0||16, 4||O:||8 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 4\Scsi Bus 4\Target Id 0\Logical Unit Id 4||0||16, 1||U:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 4\Scsi Bus 4\Target Id 0\Logical Unit Id 4||0||16, 5||X:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||3||0, 0||C:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||3||0, 7||D:||309 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||3||0, 9||G:||13 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||3||0, 2||I:||19 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||3||0, 6||J:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||3||0, 1||K:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||3||0, 1||L:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||3||0, 1||M:||7 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||3||0, 4||O:||8 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||3||0, 1||U:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||3||0, 5||X:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||5||16, 0||C:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||5||16, 7||D:||309 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||5||16, 9||G:||13 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||5||16, 2||I:||19 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||5||16, 6||J:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||5||16, 1||K:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||5||16, 1||L:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||5||16, 1||M:||7 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||5||16, 4||O:||8 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||5||16, 1||U:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||5||16, 5||X:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||4||8, 0||C:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||4||8, 7||D:||309 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||4||8, 9||G:||13 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||4||8, 2||I:||19 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||4||8, 6||J:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||4||8, 1||K:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||4||8, 1||L:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||4||8, 1||M:||7 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||4||8, 4||O:||8 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||4||8, 1||U:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 4\Logical Unit Id 0||4||8, 5||X:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||6||4, 0||C:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||6||4, 7||D:||309 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||6||4, 9||G:||13 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||6||4, 2||I:||19 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||6||4, 6||J:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||6||4, 1||K:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||6||4, 1||L:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||6||4, 1||M:||7 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||6||4, 4||O:||8 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||6||4, 1||U:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||6||4, 5||X:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||7||309, 0||C:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||7||309, 7||D:||309 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||7||309, 9||G:||13 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||7||309, 2||I:||19 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||7||309, 6||J:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||7||309, 1||K:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||7||309, 1||L:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||7||309, 1||M:||7 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||7||309, 4||O:||8 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||7||309, 1||U:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||7||309, 5||X:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||8||4, 0||C:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||8||4, 7||D:||309 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||8||4, 9||G:||13 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||8||4, 2||I:||19 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||8||4, 6||J:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||8||4, 1||K:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||8||4, 1||L:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||8||4, 1||M:||7 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||8||4, 4||O:||8 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||8||4, 1||U:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 5\Logical Unit Id 0||8||4, 5||X:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 0\Logical Unit Id 0||1||4, 0||C:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 0\Logical Unit Id 0||1||4, 7||D:||309 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 0\Logical Unit Id 0||1||4, 9||G:||13 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 0\Logical Unit Id 0||1||4, 2||I:||19 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 0\Logical Unit Id 0||1||4, 6||J:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 0\Logical Unit Id 0||1||4, 1||K:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 0\Logical Unit Id 0||1||4, 1||L:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 0\Logical Unit Id 0||1||4, 1||M:||7 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 0\Logical Unit Id 0||1||4, 4||O:||8 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 0\Logical Unit Id 0||1||4, 1||U:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 0\Logical Unit Id 0||1||4, 5||X:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||10||0, 0||C:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||10||0, 7||D:||309 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||10||0, 9||G:||13 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||10||0, 2||I:||19 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||10||0, 6||J:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||10||0, 1||K:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||10||0, 1||L:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||10||0, 1||M:||7 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||10||0, 4||O:||8 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||10||0, 1||U:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||10||0, 5||X:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||9||13, 0||C:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||9||13, 7||D:||309 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||9||13, 9||G:||13 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||9||13, 2||I:||19 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||9||13, 6||J:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||9||13, 1||K:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||9||13, 1||L:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||9||13, 1||M:||7 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||9||13, 4||O:||8 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||9||13, 1||U:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 6\Logical Unit Id 0||9||13, 5||X:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 3\Logical Unit Id 0||2||19, 0||C:||16 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 3\Logical Unit Id 0||2||19, 7||D:||309 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 3\Logical Unit Id 0||2||19, 9||G:||13 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 3\Logical Unit Id 0||2||19, 2||I:||19 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 3\Logical Unit Id 0||2||19, 6||J:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 3\Logical Unit Id 0||2||19, 1||K:||4 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 3\Logical Unit Id 0||2||19, 1||L:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 3\Logical Unit Id 0||2||19, 1||M:||7 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 3\Logical Unit Id 0||2||19, 4||O:||8 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 3\Logical Unit Id 0||2||19, 1||U:||0 HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\SCSI Port 5\Scsi Bus 0\Target Id 3\Logical Unit Id 0||2||19, 5||X:||16   select objects 
"Caption, DeviceID, InterfaceType, Model, Name, SCSIPort, SCSIBus, SCSITargetID, SCSILogicalUnit, Size FROM Win32_DiskDrive" of wmi %0ainstance of Win32_DiskDrive%0a
{%0a%09Caption = 
"RDAC Virtual Disk";%0a%09DeviceID = 
"\\\\.\\PHYSICALDRIVE11";%0a%09InterfaceType = 
"SCSI";%0a%09Model = 
"RDAC Virtual Disk";%0a%09Name = 
"\\\\.\\PHYSICALDRIVE11";%0a%09SCSIBus = 0;%0a%09SCSILogicalUnit = 0;%0a%09SCSIPort = 5;%0a%09SCSITargetId = 1;%0a%09Size = 
"1069286400";%0a
};%0a %0ainstance of Win32_DiskDrive%0a
{%0a%09Caption = 
"RDAC Virtual Disk";%0a%09DeviceID = 
"\\\\.\\PHYSICALDRIVE12";%0a%09InterfaceType = 
"SCSI";%0a%09Model = 
"RDAC Virtual Disk";%0a%09Name = 
"\\\\.\\PHYSICALDRIVE12";%0a%09SCSIBus = 0;%0a%09SCSILogicalUnit = 1;%0a%09SCSIPort = 5;%0a%09SCSITargetId = 1;%0a%09Size = 
"8373335040";%0a
};%0a %0ainstance of Win32_DiskDrive%0a
{%0a%09Caption = 
"DELL Container SCSI Disk Device";%0a%09DeviceID = 
"\\\\.\\PHYSICALDRIVE0";%0a%09InterfaceType = 
"SCSI";%0a%09Model = 
"DELL Container SCSI Disk Device";%0a%09Name = 
"\\\\.\\PHYSICALDRIVE0";%0a%09SCSIBus = 4;%0a%09SCSILogicalUnit = 0;%0a%09SCSIPort = 4;%0a%09SCSITargetId = 0;%0a%09Size = 
"18194319360";%0a
};%0a %0ainstance of Win32_DiskDrive%0a
{%0a%09Caption = 
"PowerDevice by PowerPath";%0a%09DeviceID = 
"\\\\.\\PHYSICALDRIVE3";%0a%09InterfaceType = 
"SCSI";%0a%09Model = 
"PowerDevice by PowerPath";%0a%09Name = 
"\\\\.\\PHYSICALDRIVE3";%0a%09SCSIBus = 0;%0a%09SCSILogicalUnit = 0;%0a%09SCSIPort = 5;%0a%09SCSITargetId = 4;%0a%09Size = 
"41126400";%0a
};%0a %0ainstance of Win32_DiskDrive%0a
{%0a%09Caption = 
"PowerDevice by PowerPath";%0a%09DeviceID = 
"\\\\.\\PHYSICALDRIVE5";%0a%09InterfaceType = 
"SCSI";%0a%09Model = 
"PowerDevice by PowerPath";%0a%09Name = 
"\\\\.\\PHYSICALDRIVE5";%0a%09SCSIBus = 0;%0a%09SCSILogicalUnit = 246;%0a%09SCSIPort = 5;%0a%09SCSITargetId = 4;%0a%09Size = 
"18095616000";%0a
};%0a %0ainstance of Win32_DiskDrive%0a
{%0a%09Caption = 
"PowerDevice by PowerPath";%0a%09DeviceID = 
"\\\\.\\PHYSICALDRIVE4";%0a%09InterfaceType = 
"SCSI";%0a%09Model = 
"PowerDevice by PowerPath";%0a%09Name = 
"\\\\.\\PHYSICALDRIVE4";%0a%09SCSIBus = 0;%0a%09SCSILogicalUnit = 245;%0a%09SCSIPort = 5;%0a%09SCSITargetId = 4;%0a%09Size = 
"9047808000";%0a
};%0a %0ainstance of Win32_DiskDrive%0a
{%0a%09Caption = 
"PowerDevice by PowerPath";%0a%09DeviceID = 
"\\\\.\\PHYSICALDRIVE6";%0a%09InterfaceType = 
"SCSI";%0a%09Model = 
"PowerDevice by PowerPath";%0a%09Name = 
"\\\\.\\PHYSICALDRIVE6";%0a%09SCSIBus = 0;%0a%09SCSILogicalUnit = 0;%0a%09SCSIPort = 5;%0a%09SCSITargetId = 5;%0a%09Size = 
"5362882560";%0a
};%0a %0ainstance of Win32_DiskDrive%0a
{%0a%09Caption = 
"PowerDevice by PowerPath";%0a%09DeviceID = 
"\\\\.\\PHYSICALDRIVE7";%0a%09InterfaceType = 
"SCSI";%0a%09Model = 
"PowerDevice by PowerPath";%0a%09Name = 
"\\\\.\\PHYSICALDRIVE7";%0a%09SCSIBus = 0;%0a%09SCSILogicalUnit = 1;%0a%09SCSIPort = 5;%0a%09SCSITargetId = 5;%0a%09Size = 
"332852405760";%0a
};%0a %0ainstance of Win32_DiskDrive%0a
{%0a%09Caption = 
"PowerDevice by PowerPath";%0a%09DeviceID = 
"\\\\.\\PHYSICALDRIVE8";%0a%09InterfaceType = 
"SCSI";%0a%09Model = 
"PowerDevice by PowerPath";%0a%09Name = 
"\\\\.\\PHYSICALDRIVE8";%0a%09SCSIBus = 0;%0a%09SCSILogicalUnit = 2;%0a%09SCSIPort = 5;%0a%09SCSITargetId = 5;%0a%09Size = 
"5362882560";%0a
};%0a %0ainstance of Win32_DiskDrive%0a
{%0a%09Caption = 
"PowerDevice by PowerPath";%0a%09DeviceID = 
"\\\\.\\PHYSICALDRIVE1";%0a%09InterfaceType = 
"SCSI";%0a%09Model = 
"PowerDevice by PowerPath";%0a%09Name = 
"\\\\.\\PHYSICALDRIVE1";%0a%09SCSIBus = 0;%0a%09SCSILogicalUnit = 0;%0a%09SCSIPort = 5;%0a%09SCSITargetId = 0;%0a%09Size = 
"5362882560";%0a
};%0a %0ainstance of Win32_DiskDrive%0a
{%0a%09Caption = 
"PowerDevice by PowerPath";%0a%09DeviceID = 
"\\\\.\\PHYSICALDRIVE10";%0a%09InterfaceType = 
"SCSI";%0a%09Model = 
"PowerDevice by PowerPath";%0a%09Name = 
"\\\\.\\PHYSICALDRIVE10";%0a%09SCSIBus = 0;%0a%09SCSILogicalUnit = 1;%0a%09SCSIPort = 5;%0a%09SCSITargetId = 6;%0a%09Size = 
"1069286400";%0a
};%0a %0ainstance of Win32_DiskDrive%0a
{%0a%09Caption = 
"PowerDevice by PowerPath";%0a%09DeviceID = 
"\\\\.\\PHYSICALDRIVE9";%0a%09InterfaceType = 
"SCSI";%0a%09Model = 
"PowerDevice by PowerPath";%0a%09Name = 
"\\\\.\\PHYSICALDRIVE9";%0a%09SCSIBus = 0;%0a%09SCSILogicalUnit = 0;%0a%09SCSIPort = 5;%0a%09SCSITargetId = 6;%0a%09Size = 
"15027586560";%0a
};%0a %0ainstance of Win32_DiskDrive%0a
{%0a%09Caption = 
"PowerDevice by PowerPath";%0a%09DeviceID = 
"\\\\.\\PHYSICALDRIVE2";%0a%09InterfaceType = 
"SCSI";%0a%09Model = 
"PowerDevice by PowerPath";%0a%09Name = 
"\\\\.\\PHYSICALDRIVE2";%0a%09SCSIBus = 0;%0a%09SCSILogicalUnit = 0;%0a%09SCSIPort = 5;%0a%09SCSITargetId = 3;%0a%09Size = 
"20587875840";%0a
};%0a   select objects 
"Antecedent,Dependent from Win32_LogicalDiskToPartition" of wmi %0ainstance of Win32_LogicalDiskToPartition%0a
{%0a%09Antecedent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_DiskPartition.DeviceID=\"Disk #0, Partition #1\"";%0a%09Dependent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_LogicalDisk.DeviceID=\"C:\"";%0a
};%0a %0ainstance of Win32_LogicalDiskToPartition%0a
{%0a%09Antecedent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_DiskPartition.DeviceID=\"Disk #7, Partition #0\"";%0a%09Dependent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_LogicalDisk.DeviceID=\"D:\"";%0a
};%0a %0ainstance of Win32_LogicalDiskToPartition%0a
{%0a%09Antecedent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_DiskPartition.DeviceID=\"Disk #9, Partition #0\"";%0a%09Dependent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_LogicalDisk.DeviceID=\"G:\"";%0a
};%0a %0ainstance of Win32_LogicalDiskToPartition%0a
{%0a%09Antecedent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_DiskPartition.DeviceID=\"Disk #2, Partition #0\"";%0a%09Dependent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_LogicalDisk.DeviceID=\"I:\"";%0a
};%0a %0ainstance of Win32_LogicalDiskToPartition%0a
{%0a%09Antecedent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_DiskPartition.DeviceID=\"Disk #6, Partition #0\"";%0a%09Dependent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_LogicalDisk.DeviceID=\"J:\"";%0a
};%0a %0ainstance of Win32_LogicalDiskToPartition%0a
{%0a%09Antecedent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_DiskPartition.DeviceID=\"Disk #1, Partition #0\"";%0a%09Dependent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_LogicalDisk.DeviceID=\"K:\"";%0a
};%0a %0ainstance of Win32_LogicalDiskToPartition%0a
{%0a%09Antecedent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_DiskPartition.DeviceID=\"Disk #11, Partition #0\"";%0a%09Dependent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_LogicalDisk.DeviceID=\"L:\"";%0a
};%0a %0ainstance of Win32_LogicalDiskToPartition%0a
{%0a%09Antecedent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_DiskPartition.DeviceID=\"Disk #12, Partition #0\"";%0a%09Dependent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_LogicalDisk.DeviceID=\"M:\"";%0a
};%0a %0ainstance of Win32_LogicalDiskToPartition%0a
{%0a%09Antecedent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_DiskPartition.DeviceID=\"Disk #4, Partition #0\"";%0a%09Dependent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_LogicalDisk.DeviceID=\"O:\"";%0a
};%0a %0ainstance of Win32_LogicalDiskToPartition%0a
{%0a%09Antecedent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_DiskPartition.DeviceID=\"Disk #10, Partition #0\"";%0a%09Dependent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_LogicalDisk.DeviceID=\"U:\"";%0a
};%0a %0ainstance of Win32_LogicalDiskToPartition%0a
{%0a%09Antecedent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_DiskPartition.DeviceID=\"Disk #5, Partition #0\"";%0a%09Dependent = 
"\\\\BPGA030AFMGT\\root\\cimv2:Win32_LogicalDisk.DeviceID=\"X:\"";%0a
};%0a

If I can free up some time I’ll try to work on it some more.

Thanks,

Jim