Using powershell we can start symantec antivirus scan on multiple remote computers, keep our windows desktops and servers healthy, and scanned is really important.
IT admins often log in to servers and run the Symantec antivirus manually when the scan date is old, it is difficult when there are many servers or desktop computers to scan manually, here in this article we explain how a simple Powershell script runs on multiple remote computers and performs the scan.
We need to create a file for storing all the user accounts list that are locking out, I named it as UserNames.txt and saved it in my local machine c:\temp\UserNames.txt
$allservers
$Allservers = Get-Content "C:\temp\Allservers.txt"
foreach($Server in $Allservers)
{
$arg1 = '/c'
$arg2 = '/ScanAllDrives'
$logFile = '/LOGFILE="C:\Users\user\AppData\Local\Symantec\Symantec Endpoint Protection\Logs\scan.log"'
Invoke-Command -ComputerName $server -ScriptBlock {& "C:\Program Files (x86)\Symantec\Symantec Endpoint Protection\12.1\Bin\DoScan.exe" $Args[0] $Args[1] $Args[2]} -ArgumentList $arg1, $arg2, $logFileacaddress -AsJob
}
Above script starts the scan on multiple remote computers, first one can test it on a single server or desktop machine and then use for multiple computers.
Note: My symantec version is C:\Program Files (x86)\Symantec\Symantec Endpoint Protection\12.1, in your case it might be different please check the symantec version running on the remote computers and change the script accordingly, if it doesn’t work.
Thank you for visiting my site, for any scripts in these articles you are testing please make sure you have tested this script in your lower environment before you run in production.
I hope you find this article useful if you have any questions please let us know.
Leave a Reply Cancel reply