We are in an environment where users don't attend site regular. We have opted to use our RMM software (Atera) to deploy a script out remotely to users who have just a internet connection. However it seems that the script is having issues deploying down the program to run. Sophos have recommended we post it here for assistance as I am a bit lost on where to go here , not knowing powershell at all.
###
# Author: Dave Long <dlong@cagedata.com>
# Downloads and installs Sophos
###
###
# Update the below variables to match your setup
$SophosUrl = "Our link to the install via our Sophos Central Endpoint"
$AteraAPIKey = "Obtained and Confirmed Correct API Key"
$SophosTokenCustomValueName = "346cd89ee3e290a6cf997ab28b08a794"
$InstalledProducts = "all" # Can be "all" or a comma-separated list including any of the following: antivirus, intercept, mdr, deviceEncryption, uem
###
if ($null -eq (Get-Module -ListAvailable PSAtera)) {
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module -Name PSAtera -Force
}
Set-AteraAPIKey -APIKey $AteraAPIKey
$Agent = Get-AteraAgent
$SophosToken = Get-AteraCustomValue -ObjectType Customer -ObjectID $Agent.customerID -FieldName "Sophos Token"
if ($SophosToken.ValueAsString -eq "") {
Write-Error "Sophos Token not defined on Customer Record."
exit
}
$SophosInstaller = Join-Path -Path $env:TEMP -ChildPath "SophosSetup.exe"
Invoke-WebRequest -Uri $SophosUrl -OutFile $SophosInstaller
& $sophosInstaller --customertoken="$($SophosToken.ValueAsString)" --epinstallerserver="api-cloudstation-us-east-2.prod.hydra.sophos.com" --products="all" --quiet
do {
Get-Process -Name "*SophosSetup.exe*"
Start-Sleep -Seconds 10
} while (Get-Process -Name "*SophosSetup.exe*" -ErrorAction SilentlyContinue)
Get-Service -Name "*Sophos*"
The error we get is below:
Begining the installation c:\temp\ already exists Start-Process : This command cannot be run due to the error: The system cannot find the file specified. At C:\Program Files\ATERA Networks\AteraAgent\Packages\AgentPackageSystemTools\96e455eb-e599-4cdd-8745-8d5780e89485_Sophos Intercept X Installer (copy).ps1:47 char:1 + Start-Process -FilePath "C:\Program Files\Sophos\Sophos UI\Sophos UI. ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
This thread was automatically locked due to age.