Discussion:
Whats wrong with this query.....
(too old to reply)
kiran
2009-11-19 15:18:49 UTC
Permalink
Hi All,

I am trying to use the below query, but every time it fails with a
Invalid object path error.

"ASSOCIATORS OF
{Win32_NetworkAdapterConfiguration.SettingID=""{E44212B3-348C-4F4E-8601-
D575CD5E6128}""} WHERE ResultClass=Win32_NetworkAdapter"

I googled and found out that if the path has '}', then it needs to be
in double double quoted strings. I have tried lots of combinations but
unfortunately couldn't get it to work.

Thanks,
urkec
2009-11-19 19:09:01 UTC
Permalink
Post by kiran
Hi All,
I am trying to use the below query, but every time it fails with a
Invalid object path error.
"ASSOCIATORS OF
{Win32_NetworkAdapterConfiguration.SettingID=""{E44212B3-348C-4F4E-8601-
D575CD5E6128}""} WHERE ResultClass=Win32_NetworkAdapter"
I googled and found out that if the path has '}', then it needs to be
in double double quoted strings. I have tried lots of combinations but
unfortunately couldn't get it to work.
Thanks,
.
If you want to use the path to an instance of a WMI class in a query you
need to specify the values of the key properties.
Win32_NetworkAdapterConfiguration key property is Index, not SettingId which
is inherited from CIM_Setting. Here is what the query would look like

Associators Of {Win32_NetworkAdapterConfiguration.Index=1} Where ResultClass
= Win32_NetworkAdapter

Note that there are no spaces in '.Index=1' . I don't know why you are using
the SettignId property, but for that to work you would first need to get a
collection of objects with the specified SettingId value, and get associated
Win32_NetworkAdapter instances for each object in the collection.
--
urkec

My blog:
http://theadminblog.blogspot.com/

My CodeProject articles:
http://www.codeproject.com/script/Articles/MemberArticles.aspx?amid=4210975
Loading...