【问题标题】:Script powershell for know Mcafee agent Version and Protection Version用于了解 Mcafee 代理版本和保护版本的脚本 powershell
【发布时间】:2019-03-20 18:47:49
【问题描述】:

我想知道 AV Mcafee 和 Endpoint 的代理版本,很明显我在 ePo 控制台上没有连接。

我得到了这个脚本:

$AgentVer = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("LocalMachine",$Computer).OpenSubKey('HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\McAfee\AgentVersion').GetValue('AgentVersion')
$ProductVer = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine',$Computer).OpenSubKey('HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\McAfee\SystemCore').GetValue('') 



      " $AgentVer   Agent version: $AgentVer
        $computer   Product version: $ProductVer

但是执行时我得到:

您不能在空值表达式上调用方法。 在行:2 字符:1 + $AgentVer = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("LocalMa ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull 您不能在空值表达式上调用方法。 在行:3 字符:1 + $ProductVer = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('本地 ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull 代理版本: 10.1.1.1 产品版本:

我不知道怎么跟,有大神能帮帮我吗?

问候和感谢

【问题讨论】:

    标签: powershell


    【解决方案1】:

    这应该适合你。

    $AgentVersion = (Get-ItemProperty -Path "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\McAfee\Agent"
    $ProductVersion = (Get-ItemProperty -Path "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\McAfee\SystemCore"
    
    $AgentVersion.AgentVersion
    $ProductVersion.System_Core_Version
    
    

    【讨论】:

      【解决方案2】:

      您已经在OpenRemoteBaseKey 调用中指定了注册表配置单元LocalMachine,因此不应在OpenSubKey 的参数中重复。此外,您应该只给出OpenSubKey 的子键路径,而不是值的全名。这应该有效:

      $hklm = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("LocalMachine", $Computer)
      $subkey = $hklm.OpenSubKey("SOFTWARE\Wow6432Node\McAfee")
      $AgentVer = $subkey.GetValue("AgentVersion")
      $ProductVer = $subkey.GetValue("SystemCore")
      

      【讨论】:

        猜你喜欢
        • 2018-11-17
        • 1970-01-01
        • 1970-01-01
        • 2015-02-16
        • 2016-10-18
        • 2019-11-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多