#It's a startup script, so wait for 4 minutes, want to make sure computer is #authenticated w/ network. Start-Sleep -Seconds 120 #Attempt to stop the 'tmumh' service. Pesky service that prevents falcon installer #while Trend Micro is still installed. Had to disable tamper protection first to #allow this to work. try { Stop-Service -Name 'tmumh' -ErrorAction Stop Write-Host "Service 'tmumh' stopped successfully." } catch { Write-Host "Failed to stop service 'tmumh': $_" } # Check the 'tmumh' service status $service = Get-Service -Name 'tmumh' -ErrorAction SilentlyContinue if ($service.Status -eq 'Running') { Write-Host "Service 'tmumh' is still running. Script will not proceed." exit } else { Write-Host "Service 'tmumh' is not running. Proceeding with script." } # Update these variables as needed $CID = 'CHANGEME10468FAC3324CE189FA4D2-72' $SensorShare = '\\server\sysvol\domain.local\scripts\WindowsSensor.MaverickGyr.exe' # The sensor is copied to the following directory $SensorLocal = 'C:\temp\falcon.exe' # Ensure the TEMP directory exists, if not.. create if (!(Test-Path -Path 'C:\Temp')) { New-Item -ItemType Directory -Path 'C:\Temp' -Force } # Now copy the sensor installer if the share is available if (Test-Path -Path $SensorShare) { Copy-Item -Path $SensorShare -Destination $SensorLocal -Force } # Check to see if the CSFalconService is already present if (!(Get-Service -Name 'CSFalconService' -ErrorAction SilentlyContinue)) { & $SensorLocal /install /quiet /norestart CID=$CID }