Powershell script to download McAfee Daily DAT(definitions)

12/26/2017 , 0 Comments

The Below script helps you to download the McAfee virus Definitions from the McAfee website. You can configure a daily schedule task which can automatically do the download. 

#Source www.askvp.info
#This script downloads the latest DAT V2 Virus Definition Updates (DATS) from the website
# https://www.mcafee.com/apps/downloads/security-updates/security-updates.aspx
$Response = (invoke-webrequest -uri http://update.nai.com/products/commonupdater/gdeltaavv.ini)
[array]$A=$Response.Content -split "`r`n"
$CurrentVersion=$A[3].Split('=')[1]
$CurrentVersion
$URI="http://update.nai.com/products/datfiles/4.x/nai/$($CurrentVersion)xdat.exe"
$datfile = (invoke-webrequest -uri $URI).Content.RawContent
#Change this path if you wish otherwise default location is C:\temp
$output = "C:\temp\$($CurrentVersion)x.dat.exe"
$start_time = Get-Date
Invoke-WebRequest -Uri $uri -OutFile $output
Write-Output "Time taken: $((Get-Date).Subtract($start_time).Seconds) second(s)"
Write-output "Path where the DAT is saved is "$output


0 comments :