首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >可以使用PowerShell的在我自己的机器上列出AppV包吗?

可以使用PowerShell的在我自己的机器上列出AppV包吗?
EN

Stack Overflow用户
提问于 2017-11-01 14:56:29
回答 1查看 2.7K关注 0票数 1

我可以使用Get-AppvClientPackage -all | select nameGet-WmiObject -Namespace root\appv -Class AppvClientPackage |select name列出安装在我自己的计算机上的所有已安装的AppV包。在没有远程执行的情况下,使用此cmdlet将AppV包安装到另一台计算机上似乎是不可能的。

我问这个问题是希望找到一些有用的东西(见目的)或得到一个明确的答案,这是不可能的。可能有更好的选择(PS除外),但我的问题是,如果可能的话,如果是这样的话,我们可以推动开发一个脚本(可以由拥有更高权限的人运行)来收集所需的信息。

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

如果有另一个模块或cmdlet (甚至是powershell或WMI以外的其他组件)可以提供相同的信息,则欢迎提出建议。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-11-21 14:21:08

Get-WmiObject利用RPC连接到远程PC机,不需要PSRemoting。在此过程中,您所需要做的就是添加-ComputerName参数。

代码语言:javascript
运行
复制
#Requires -Version 3
$Target = 'localhost'
$Params=@{
    Namespace = 'root\appv'
    Class = 'AppvClientPackage'
    Property = 'Name'
    ComputerName = $Target
}
Get-WmiObject @Params
代码语言:javascript
运行
复制
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
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47057692

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档