PowerShell: Find Duplicated ePO GUID


McAfee ePO (ePolicy Orchestrator) client may have duplicated GUID when the computer restore to a previous system status or the computer is a clone of another one.

I wrote a script to list the computer names with duplicated GUID, so I can target and process them.

Remove-Item machines_draft.txt
# copy the ePO server log
Copy-Item “\\epo-server-name\c$\Program Files\McAfee\ePolicy Orchestrator\DB\Logs\server.log” .

$Log = Get-Content server.log

# find the computer names with duplicated GUID
foreach ($Line in $Log)
{
    if ($Line -match “IP  and MAC  has an invalid sequence number”)
    {
        $MachineName = $Line.split(” “)[1]
        echo $MachineName >> machines_draft.txt
    }
}

# sort the computer name and only print each once
Get-Content machines_draft.txt | sort | Get-Unique > machines.txt
echo ***********Machines_With_Duplicated_GUID*******************
Get-Content machines.txt

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s