MECM 上存储部署类型安装程序的 WMI 类是什么
我需要通过 WMI 类检索与 MECM 应用程序相关的数据,更具体地说,我需要获取应用程序部署类型属性 - 安装/卸载程序。
您能帮我一下吗,我可以使用什么确切的 WMI 类来获取此信息。
感谢您的帮助。
I need to retreive a data related the MECM Application via WMI classes, more specifically, I need to get Application Deployment Type properties - Installation / Uninstallation programs.
Could you please help me, what exact WMI class can I use to obtain this information.
Thank you for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,这并不是很容易获取信息,但在 powershell(或任何可以真正访问 wmi 的编程语言)的帮助下,这是可以完成的。
信息本身存储在属性
SDMPackageXML
的SMS_Application
类中。现在,如果您查询此内容,您会注意到的第一件事是它可能是空的。那是因为它是一个惰性属性。要在 PS 中解决此问题,您必须在 wmi 对象上调用额外的
get()
。如果您这样做(或者有一些工具可以显示所有惰性参数),您会注意到它(如名称所示)基本上是一个 XML 文档,它在内部存储了您需要的信息。因此您必须从 XML 中提取它。
关于如何为单个应用程序执行此操作的一些示例代码如下:
我不太擅长 xml 解析,因此可能有更好的方法来做到这一点,或者也许您不需要解析,但可以只对 xml 摘要进行字符串比较。只需首先查看 SDMPackageXML,然后您可能就会了解如何根据自己的需求最好地分析它。
This is unfortunately not very easy to get information afaik, but with some help from powershell (or any programming language that can access wmi really) it can be done.
The information itself is stored within the Class
SMS_Application
in the PropertySDMPackageXML
.Now the first thing you will notice if you query this is it is probably empty. That is because it is a lazy property. To work around this in PS you have to for example call an extra
get()
on your wmi object.If you do this (or have some tool that just shows all lazy parameters anyway) you will notice it is - as suggested by the name - basically an XML document, that stores the information you need deep inside. So you have to extract it from within the XML.
Some example code on how to do this for a single app would be:
I'm not great with xml parsing so there might be a better way to do it or maybe you don't need the parsing but can just string compare the xml digest. Just start by looking at a SDMPackageXML and then you will probably see how to best analyze it for your own needs.