1

我可以使用Get-AppvClientPackage -all[ | select name] 或Get-WmiObject -Namespace root\appv -Class AppvClientPackage[ |select name] 列出我自己机器上安装的所有已安装 AppV 包。如果没有远程执行,似乎无法使用此 cmdlet 将 AppV 包安装在另一台计算机上。

我问这个问题是希望找到一些有效的东西(见目的)或得到一个不可能的明确答案。可能有更好的选择(除了 PS),但我的问题很简单,如果可能的话,如果是后者,我们可以推动开发一个脚本(可以由具有提升权限的人运行) 收集所需的信息。

目的:我们的团队不了解 SCCM(另一种选择是让该团队报告安装在哪里,尽管有时我们需要快速回答)并且远程 PS 执行仅限于一个安全团队(这是可以理解的),但有时(出于支持或停用目的)我们需要检查特定客户端计算机是否安装了包,检查特定客户端安装了哪些 AppV 包,以及查看哪些机器安装了特定包。

如果有其他模块或 cmdlet(甚至是 powershell 或 WMI 以外的其他东西)可能能够产生相同的信息,欢迎提出建议。

4

1 回答 1

1

Get-WmiObject利用RPC连接到远程 PC 并且不需要PSRemoting. 在这项工作中,您需要做的就是添加-ComputerName参数。

#Requires -Version 3
$Target = 'localhost'
$Params=@{
    Namespace = 'root\appv'
    Class = 'AppvClientPackage'
    Property = 'Name'
    ComputerName = $Target
}
Get-WmiObject @Params

PS C:\> Get-Help -Name 'Get-WmiObject' -Parameter 'ComputerName'

-ComputerName <String[]>
    Specifies the target computer for the management operation. Enter a fully
    qualified domain name (FQDN), a NetBIOS name, or an IP address. When the remote
    computer is in a different domain than the local computer, the fully qualified
    domain name is required.

    The default is the local computer. To specify the local computer, such as in a
    list of computer names, use "localhost", the local computer name, or a dot (.).

    This parameter does not rely on Windows PowerShell remoting, which uses
    WS-Management. You can use the ComputerName parameter of Get-WmiObject even if
    your computer is not configured to run WS-Management remote commands.

    Required?                    false
    Position?                    named
    Default value                None
    Accept pipeline input?       False
    Accept wildcard characters?  false
于 2017-11-21T14:21:08.260 回答