logonewone

How to clear powershell.exe Malware by list of computers

Create updateCheckServers.txt in the same folder for list of computers

$servers = get-content updateCheckServers.txt
$ReportFile = “malwareReport”+(Get-Date -Format “yyyyMMdd”)+”.csv”
foreach ($server in $servers) {
  $fileStatus = “Not Found”
  $path = “\\”+ $server +”\c$\removeMalware.txt”
  if (test-path -path “$path”){
      $fileStatus = “Good”
  }
  Add-Content $ReportFile “$server,$fileStatus”
}