我可以使用Get-AppvClientPackage -all | select name或Get-WmiObject -Namespace root\appv -Class AppvClientPackage |select name列出安装在我自己的计算机上的所有已安装的AppV包。在没有远程执行的情况下,使用此cmdlet将AppV包安装到另一台计算机上似乎是不可能的。
我问这个问题是希望找到一些有用的东西(见目的)或得到一个明确的答案,这是不可能的。可能有更好的选择(PS除外),但我的问题是,如果可能的话,如果是这样的话,我们可以推动开发一个脚本(可以由拥有更高权限的人运行)来收集所需的信息。
目的:我们的团队不具备SCCM的可见性(另一种选择是让团队报告安装在哪里,尽管有时我们需要快速回答),远程PS执行仅限于一个安全团队(这是可以理解的),但有时(为了支持或退役目的),我们需要检查特定的客户端计算机是否安装了包,检查特定客户端安装了什么AppV包,以及检查哪些机器安装了特定的包。
如果有另一个模块或cmdlet (甚至是powershell或WMI以外的其他组件)可以提供相同的信息,则欢迎提出建议。
发布于 2017-11-21 14:21:08
Get-WmiObject利用RPC连接到远程PC机,不需要PSRemoting。在此过程中,您所需要做的就是添加-ComputerName参数。
#Requires -Version 3
$Target = 'localhost'
$Params=@{
Namespace = 'root\appv'
Class = 'AppvClientPackage'
Property = 'Name'
ComputerName = $Target
}
Get-WmiObject @ParamsPS 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? falsehttps://stackoverflow.com/questions/47057692
复制相似问题