【问题标题】:How to find what are all the softwares installed/Uninstalled today?如何查找今天安装/卸载的所有软件?
【发布时间】:2012-03-01 20:21:11
【问题描述】:

在我们的虚拟机中,我们将查看特定日期安装/卸载的应用程序

有没有办法自动找到呢?

【问题讨论】:

    标签: powershell batch-file installation powershell-2.0


    【解决方案1】:

    WMI 接口应该适用于此。使用命令行:wmic product

    这里有一个blog article,它更详细地描述了它以及如何以 .csv 文件的形式获取结果。

    【讨论】:

      【解决方案2】:

      我认为您无法找到有关已卸载应用程序的信息,但您可以从注册表中获取一些信息(使用 WMI,您只能获取 MSI 包):

      Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*\' | Select-Object DisplayName,InstallDate,Publisher
      

      【讨论】:

        【解决方案3】:

        要获取 msiexec 在特定日期安装的应用程序列表,请使用以下命令:

        $strComputer = "."
        
        $colItems = get-wmiobject -class "Win32_Product" -namespace "root\CIMV2" -computername $strComputer
        
        $colitems | ? { $_.installdate -eq "yyyymmdd" }| select name
        

        这适用于所有已安装的应用程序一个 Microsoft KB(需要按日期过滤):

        $Keys = Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall
        $Items = $keys |foreach-object {Get-ItemProperty $_.PsPath}
        $items | select displayname , "(default)" , installdate
        

        对于未安装的应用程序,您需要从源“MsiInstaller”查询application events logs,或在事件描述中“卸载”的“字符串搜索”。

        【讨论】:

          【解决方案4】:

          Win32_Product 类的查询速度非常慢。尽可能多地过滤。

          $computername="SomeServer"

          $apps=get-wmiobject win32_product -filter "installdate='20120206'" -computer $computername

          【讨论】:

          • 欢迎来到 stackoverflow Hicks。谢谢你的好书。我希望你的经验和知识能在你加入 stackoverflow 时对很多人有所帮助
          猜你喜欢
          • 2015-07-21
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-10-17
          • 1970-01-01
          • 2014-11-08
          • 2011-09-29
          • 2013-10-06
          相关资源
          最近更新 更多