获取已安装软件的序列号

时间:2016-01-14 11:21:11

标签: sccm

是否可以从已安装的软件(Adobe,Autodesk,VMWare等)获取序列号?

从WMI我只能获得MS密钥 - 操作系统/办公室。有没有办法从SCCMAD收到它?

2 个答案:

答案 0 :(得分:2)

我所知道的并不简单。这取决于每个应用程序,如果您很幸运并且他们将信息存储在注册表中,那么您可以将其添加到软件清单中,但如果它是在加密密钥文件中(因为我怀疑Adobe使用)然后你几乎没有运气。

答案 1 :(得分:0)

对于非REG-BINARY类型,我使用此脚本从csv文件中读取信息。所以我不需要任何解码操作。

    $csv = Import-CSV "\\fs-lv-01\users$\username\Desktop\PowerShell\TSTArray.csv"
    $resultsarray = @()

    $target = $env:COMPUTERNAME
    $hklm = "HKLM:"
    $join_path = $hklm, $regPath -join "\"

    Foreach ($Registry in $csv)
    {
                    $regPath = $Registry.regPath
                    $regValue = $Registry.regValue
                    $join_path = $hklm, $regPath -join "\"

        If ($Registry.regPath -ne 0)
        {
            $data = (Get-ItemProperty -Path $join_path -name $regValue -ErrorAction SilentlyContinue).$regValue 

            IF ($data -ne $null)
            {
                $obj = New-Object Object
                $obj | Add-Member Noteproperty Computer -value $target
                $obj | Add-Member Noteproperty ProductKey -value $data
                $obj

                $resultsarray += $obj
            }
        }

    }

    $resultsarray | Export-Csv "\\fs-lv-01\users$\username\Desktop\PowerShell\TSTSerialNumbers.csv" -NoTypeInformation

Microsoft产品的相同想法:

$csv = Import-CSV "\\fs-lv-01\users$\username\Desktop\PowerShell\MSArray.csv"
$resultsarray = @()

$hklm = 2147483650
$target = $env:COMPUTERNAME

Foreach ($Registry in $csv)
{
                $regPath = $Registry.regPath
                $regValue = $Computer_name.regValue

    If ($Registry.regPath -ne 0)
    {
        $productKey = $null
        $win32os = $null
        $wmi = [WMIClass]"\\$target\root\default:stdRegProv"
        $data = $wmi.GetBinaryValue($hklm,$regPath,$regValue)
        $binArray = ($data.uValue)[52..66]
        $charsArray = "BCDFGHJKMPQRTVWXY2346789"
        ## decrypt base24 encoded binary data
        for ($i = 24; $i -ge 0; $i--) { 
                      $r = 0 
                      for ($j = 14; $j -ge 0; $j--) { 
                        $r = ($r * 256) -bxor $binArray[$j] 
                        $binArray[$j] = [math]::Floor([double]($r/24)) 
                        $r = $r % 24 
                      } 
                      $ProductKey = $charsArray[$r] + $ProductKey 
                      if (($i % 5) -eq 0 -and $i -ne 0) { 
                        $ProductKey = "-" + $ProductKey 
                      } 
                    }
        $win32os = Get-WmiObject Win32_OperatingSystem -computer $target
        $obj = New-Object Object
        $obj | Add-Member Noteproperty Computer -value $target
        $obj | Add-Member Noteproperty Caption -value $win32os.Caption
        $obj | Add-Member Noteproperty OSArch -value $win32os.OSArchitecture
        $obj | Add-Member Noteproperty ProductKey -value $productKey
        $obj

        $resultsarray += $obj

    }

}

$resultsarray | Export-Csv "\\fs-lv-01\users$\username\Desktop\PowerShell\SerialNumbers.csv" -NoTypeInformation

两个脚本都经过测试,但我也希望获得Adobe个密钥..我有关于如何解码Adobe个序列号的信息,但我需要在许可版本上进行测试。