Asked by:
wmi calls for software 'LastUse'

Question
-
I would like to know, if wmi query can pull values of 'lastuse' attribute. Even though "LastUse" is an attribute of the SoftwareFeature Class defined in the Win32_SoftwareFeatureSoftwareElements association class, Querying it doesn't provide any output for 'Lastuse'. I'm using wbemtest as tool for wmi queries on a Window 10 Enterprise.
- Moved by Bill_Stewart Friday, March 15, 2019 6:37 PM Abandoned
Thursday, January 24, 2019 4:56 AM
All replies
-
You are not using the correct class.
Get-WmiObject Win32_SoftwareFeature | Select-Object name, lastuse
See: https://docs.microsoft.com/en-us/previous-versions/windows/desktop/msiprov/win32-softwarefeature
\_(ツ)_/
Thursday, January 24, 2019 5:15 AM -
Two way binding:
$feature = Get-WmiObject Win32_SoftwareFeature -Filter "Name = 'Chart_Feature'" $feature.GetRelated('Win32_SoftwareElement') $element = Get-WmiObject Win32_SoftwareElement -Filter "Name = 'ChartWinForm_gac_Component'" $element.GetRelated('Win32_SoftwareFeature')
\_(ツ)_/
Thursday, January 24, 2019 5:33 AM -
thanks jrv. I do get an Output, after running this from PowerShell.
Here is an Sample.. Do see the 'Generic Failure' not sure why that comes up?
Servicing_Key 19800000******.000000+***
VCRedistx64 19800000******.000000+***
UCRTx64 19800000******.000000+***
VC_Runtime_Additional 19800000******.000000+***
Provider 19800000******.000000+***
Servicing_Key 19800000******.000000+***
APSFeature64 19800000******.000000+***
VC_Runtime_Minimum 19800000******.000000+***
Provider 19800000******.000000+***
Get-WmiObject : Generic failure
At line:1 char:1
+ Get-WmiObject Win32_SoftwareFeature |
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Get-WmiObject], ManagementException
+ FullyQualifiedErrorId : GetWMIManagementException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
Monday, January 28, 2019 11:16 AM -
That can happen if the repository is either damaged or packages are blocking WMI due to security. It is not a scripting issue. It is a system issue.
\_(ツ)_/
Monday, January 28, 2019 11:21 AM