Endpoint Protection

 View Only

Powershell script which reads a list of systems and scans their registry to determine what version of SEP is installed on them 

Apr 05, 2010 01:32 PM

Hello everyone,

I friend asked me to write this Powershell script for him so, I thought I'd post it here for everyone else to use. The script loads in a list of servers/PCs into memory. It then remotely queries the SEP version key and display a list a machine names and their SEP versions. I hope you all find it beneficial.

[I've also attached the script to this post]

 

# ******************************************************************************

# Script which loads in a list of server or PC names, and queries their registry

# to determine what version of SEP is on them

# NOTE: it will output a list containing the machine's name and its SEP version

# I've found that anything that returns a blank version is the result of either;

# A) SEP is not installed

# B) I don't have rights to connect to the machine

# Written by Henry C. Hernandez [InfoSecWay.com]

# Date: March 24th, 2010

# Modified:

 

# Legal Stuff:

# There are no warrenties with this script.

# Use at your own risk

# ******************************************************************************

$File = Import-Csv 'c:\hostlist.csv' #NOTE: the first line of this file must say machinename

foreach ($line in $file)

{

$machinename = $line.machinename

#Continue the script even if an error happens

trap [Exception] {continue}

 

$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey("LocalMachine",$MachineName)

#Set the Reg Container

$key = "SOFTWARE\\Symantec\\Symantec Endpoint Protection\\SMC"

$regkey = "" #clears the value between loop runs

$regkey = $reg.opensubkey($key)

 

$SEPver = "" #clears the value between loop runs

#NOTE: the values between the " ' " symbols are the key you're looking for

$SEPver = $regKey.GetValue('ProductVersion')

$Results = $MachineName , $SEPver

Write-host $Results

#Write-Output ************

}


Statistics
0 Favorited
0 Views
1 Files
0 Shares
0 Downloads
Attachment(s)
zip file
CompRtrvSEPRegValFromList.zip   926 B   1 version
Uploaded - Feb 25, 2020

Tags and Keywords

Comments

May 27, 2010 03:47 PM

Thisis the one that identifies which version of SEP is on a system.

Let me see where they uploaded my other script to.

May 21, 2010 02:40 PM

Hi Henry,
Just for my clarification, does this script identify the version of SEP, or remove it? I remember yesterday you mentioned that you'd written a PowerShell
script that completely removes SEP from a system, and I wanted to be sure before I ran this.

Also, thanks again for your great presentation on Nexpose. Please remember to send me any info you may have on downloading an evaluation copy.
Hank

May 20, 2010 04:45 PM

Hey man, im not familiar with Power Shell, is there any way to just convert this into a bat file or script????

May 20, 2010 04:45 PM

Hey man, im not familiar with Power Shell, is there any way to just convert this into a bat file or script????

May 20, 2010 03:56 PM

I passed this on to the engineer in charge of SEP issues. I think he will like it.

Thanks for sharing.

-Jonathan

May 20, 2010 03:38 PM


I'm glad I could help!

Let me know how it works for you. I've never tried to run it aganist a system that thinks it has 2 version of SEP installed on it.

May 20, 2010 03:09 PM

Dude! Thank you very much. this is what we have needed to address our multiple instances of install of SEP in our environment.

Thanks!!!

Related Entries and Links

No Related Resource entered.