stefankittel
Goto Top

Skript für ESET Endpoint Antivirus und Security Upgrade auf 7.3

Hallo,

wer von Euch (bei Kunden) ESET Endpoint Antivirus und Security im Einsatz hat muss sich mit dem Upgrade auf die Version 7.3 beschäftigen.

Dieses Upgrade wird nicht automatisch ausgeführt wie andere Upgrades vorher.

Wer nun bei kleinen Kunden keine Verwaltungslösung von ESET im Einsatz hat, muss dieses von Hand erledigen.

Ich verwende Solarwinds MSP RMM und habe mir dafür 2 Powershell Skripte geschrieben.
Vieleicht helfen Sie ja Jemand anderes. Sie funktionieren auch ohne RMM.

Skript EsetInfo.ps1
Dies erzeugt "nur" einen String der Auskunft über die verwendete Version gibt.
Außerdem wird der Errorcode >0 gesetzt wenn die Version < 7.3 ist

Ausgaben
  • ESET Endpoint Security (ees) - 7.3.2041.0
  • ESET Endpoint Security (ees) - 7.2.2041.0 (Need Update !)
  • ESET NOD32 Antivirus (eav) - 14.0.22.0

# EsetInfo.ps1
# Shows ESET Antivirus installation information
# Creates by Stefan Kittel (https:{{comment_single_line_double_slash:0}}

# Output like
# ESET Endpoint Security (ees) - 7.3.2041.0
# ESET Endpoint Security (ees) - 7.2.2041.0 (Need Update !)
# ESET NOD32 Antivirus (eav) - 14.0.22.0

#https:{{comment_single_line_double_slash:1}}

$ProductName = (Get-ItemProperty -Path "HKLM:\Software\ESET\ESET Security\CurrentVersion\Info" -Name "ProductName" -ErrorAction SilentlyContinue).ProductName  
$ProductVersion = (Get-ItemProperty -Path "HKLM:\Software\ESET\ESET Security\CurrentVersion\Info" -Name "ProductVersion" -ErrorAction SilentlyContinue).ProductVersion  
$ProductType = (Get-ItemProperty -Path "HKLM:\Software\ESET\ESET Security\CurrentVersion\Info" -Name "ProductType" -ErrorAction SilentlyContinue).ProductType  
$UseExitCode = 0

If ($ProductType)
{
	# Check if Endpoint Antivirus (eea) or Endpoint Security (ees) are installed
	If ($ProductType -eq 'eea'  -OR $ProductType  -eq 'ees')  
	{
		# Check if a version below 7.3 ist installed
		$ProductVersionMain = $ProductVersion.Substring(0,1) + $ProductVersion.Substring(2,1)
		If ($ProductVersionMain  -lt 73)
		{
			$Status = " (Need Update !)"  
			$UseExitCode = 1001
		}
		ELSE
		{
			$Status = ""  
			$UseExitCode = 0
		}
	}
	ELSE
	{
		$Status = ""  
		$UseExitCode = 0
	}

	# Create output
	Write-Host $ProductName" ("$ProductType") - "$ProductVersion$Status  
	exit $UseExitCode
}
ELSE
{
	Write-Host "ESET not found"  
	exit 1001
}


Skript EsetUpdate.ps1
Dieses Skript prüft ob ein Update notwendig ist, lädt die Datei runter und installiert sie.
Danach erscheint eine Meldung von ESET, dass ein Neustart notwendig ist. Der Neustart wird nicht automatisch ausgeführt.

# EsetUpdate.ps1
# Updates ESET Endpoint < 7.3 to 7.3
# Creates by Stefan Kittel (https:{{comment_single_line_double_slash:0}}

# Output like
# Update Failed (reason)
# Update OK
# Update Not needed (reason)
# ESET not found

#https:{{comment_single_line_double_slash:1}}

$ProductType = ((Get-ItemProperty -Path "HKLM:\Software\ESET\ESET Security\CurrentVersion\Info" -Name "ProductType" -ErrorAction SilentlyContinue).ProductType).Trim()  
If (-not ($ProductType))
{
	Write-Host "ESET not found (#ProductType)"  
	exit 1001
}

$ProductVersion = ((Get-ItemProperty -Path "HKLM:\Software\ESET\ESET Security\CurrentVersion\Info" -Name "ProductVersion" -ErrorAction SilentlyContinue).ProductVersion).Trim()  
If (-not ($ProductVersion))
{
	Write-Host "ESET not found (#ProductVersion)"  
	exit 1002
}

$ProductName = ((Get-ItemProperty -Path "HKLM:\Software\ESET\ESET Security\CurrentVersion\Info" -Name "ProductName" -ErrorAction SilentlyContinue).ProductName).Trim()  
If (-not ($ProductName))
{
	Write-Host "ESET not found (#ProductName)"  
	exit 1003
}

#Write-Host "ESET found:"$ProductName" ("$ProductType") - "$ProductVersion 

# Check if Endpoint Antivirus (eea) or Endpoint Security (ees) are installed
If ($ProductType -eq 'eea'  -OR $ProductType  -eq 'ees')  
{
	# Check if a version below 7.3 ist installed
	$ProductVersionMain = $ProductVersion.Substring(0,1) + $ProductVersion.Substring(2,1)
	If ($ProductVersionMain  -lt 74)
	{
		If ($ProductType -eq 'eea')  
		{
			$Url = "https://download.eset.com/com/eset/apps/business/eea/windows/latest/eea_nt64.msi"  
		}
		If ($ProductType -eq 'ees')  
		{
			$Url = "https://download.eset.com/com/eset/apps/business/ees/windows/latest/ees_nt64.msi"  
		}
		
		$FileName = "c:\temp\eset_upgrade.msi"  
		if (Test-Path $FileName)
		{
			Remove-Item $FileName
		}
		
		$WebClient = New-Object System.Net.WebClient
		$WebClient.DownloadFile($Url,$FileName)
		
		if (-not (Test-Path $FileName))
		{
			Write-Host "Download failed!"  
			exit = 1004
		}
		
		Start-Process msiexec.exe -Wait -ArgumentList '/I c:\temp\eset_upgrade.msi /quiet'  
		
		Write-Host "Update started"  
		exit 0
	}
	ELSE
	{
		Write-Host "No Update needed (>=7.3)"  
		exit 0
	}
}
ELSE
{
	Write-Host "No Update needed (no eea or ees)"  
	exit 0
}

Content-Key: 620744

Url: https://administrator.de/contentid/620744

Printed on: April 19, 2024 at 17:04 o'clock