Tuesday, July 12, 2016






The highlighted lines are what I added to the script.
There is a lot of handy information under the public-opstate section of the registry for SEP.

SEPVersionCheckv2-test.ps1

$cred = Get-Credential -Message "User Info" -UserName "wf\$env:USERNAME-a"
#$cred2 = Get-Credential -Message "User Info" -UserName "wesdevdomain\a656673"
$today = Get-Date -UFormat "%Y%m%d_%H%M"
$serverlist = read-host "Location of Server Names"
$servers = Get-Content $serverlist
$HKLM = 2147483650
$SEP = @()
foreach($server in $servers){
$reg = Get-WmiObject -List -Namespace root\default -ComputerName $server -Credential $cred | Where-Object {$_.Name -eq "StdRegProv"}
$properties=@{
    'Server'          = $server ;
    'SEPVersion'      = $reg.GetStringValue($HKLM,"SOFTWARE\Symantec\Symantec Endpoint Protection\CurrentVersion","PRODUCTVERSION").sValue;
    'SEPDEFDate'      = $reg.GetStringValue($HKLM,"SOFTWARE\Symantec\Symantec Endpoint Protection\CurrentVersion\public-opstate","LatestVirusDefsDate").sValue;
    'SEPDEFVersion'   = $reg.GetStringValue($HKLM,"SOFTWARE\Symantec\Symantec Endpoint Protection\CurrentVersion\public-opstate","LatestVirusDefsRevision").sValue;
    }
$output = New-Object -TypeName PSObject -Property $properties
$SEP+=$output
   
}

$SEP | Export-Csv "c:\temp\SEPVersion_$($today).csv"