How to run a WMI query to get an element of a class?


hello everyone,

i trying run powershell query value of element inside class instance. how can accomplish this?

i tried this...

ps c:\windows\system32> get-wmiobject dcim_biospassword -namespace root\dcim\sysman | select attributename,isset

attributename                                                                 isset
-------------                                                                       -----
adminpwd                                                                       true
systempwd                                                                     false

and result of both instances; (because there 2 instances inside class!) want result of 1 instance.



thank in advance.



i don't have namespace on maqchine can not test, looking @ pic, class has instanceid.

can run following verify

get-wmiobject dcim_biospassword -namespace root\dcim\sysman | get-member

if there member of instanceid can pipe on where-object cmdlet filter results

get-wmiobject dcim_biospassword -namespace root\dcim\sysman | { $_.instanceid -eq "instancename" } | select attributename, isset

change "instancename" instance want

or can possible like

get-wmiobject dcim_biospassword -namespace root\dcim\sysman -filter "instanceid='instancename'" | select attributename, isset


if find post has answered question, please mark answer. if find post helpful in anyway, please click vote helpful.

don't retire technet





Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Edit Group Policy

Hyper-V VM not reaching OS 'Logon' screen

DNS question...