removed outdated Uninstall-AteraAgent.ps1 script
added current Uninstall-AteraAgent.bat script updated Install-AteraAgent.ps1 to run Uninstall-AteraAgent.bat if agent is already installed
This commit is contained in:
+15
-11
@@ -17,21 +17,25 @@ Function SourceTools
|
||||
If ( Test-Path "${Env:ProgramFiles}\ATERA Networks\AteraAgent\AteraAgent.exe" ) { $INSTALL = $false } Else { $INSTALL = $true }
|
||||
If ( $FORCE ) { $INSTALL = $true }
|
||||
If ( $INSTALL ) {
|
||||
## Download agent and get path
|
||||
$AGENT_INSTALLER = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/AteraAgentSetup.msi'
|
||||
#$AGENT_INSTALLER = Download-File -URL "http://emberkom.servicedesk.atera.com/GetAgent/Msi/?customerId=${CUSTOMER_ID}&integratorLogin=${INTEGRATOR_ID}" -File $AGENT_INSTALLER
|
||||
#$AGENT_INSTALLER = Download-File -URL 'https://packagesstore.blob.core.windows.net/installers/Fabric/MSI/1.8.0.4/Setup.msi' -FILE $AGENT_INSTALLER
|
||||
|
||||
## Uninstall if $FORCE is true
|
||||
If ( $FORCE ) {
|
||||
LogMsg "Uninstalling previously installed agent"
|
||||
$UninstallScript = Download-File -URL 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/Uninstall-AteraAgent.bat'
|
||||
Try { Start-Process "cmd.exe" -ArgumentList "/c ""${UninstallScript}""" -Wait }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
Try { Remove-Item $UninstallScript -Force }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
}
|
||||
|
||||
## Set agent URL
|
||||
$URL = 'https://dev.emberkom.com/emberkom/management-scripts/raw/branch/master/resources/AteraAgentSetup.msi'
|
||||
|
||||
## Install the agent
|
||||
#Try { Start-Process "msiexec.exe" -ArgumentList "/i ""${AGENT_INSTALLER}"" /qn /norestart" -Wait }
|
||||
LogMsg "Installing Atera agent from: ${AGENT_INSTALLER}"
|
||||
Try { Start-Process "msiexec.exe" -ArgumentList "/i ""${AGENT_INSTALLER}"" /qn /norestart INTEGRATORLOGIN=${INTEGRATOR_ID} COMPANYID=${CUSTOMER_ID}" -Wait }
|
||||
LogMsg "Installing Atera agent from: ${URL}"
|
||||
Try { Start-Process "msiexec.exe" -ArgumentList "/i ""${URL}"" /qn /norestart INTEGRATORLOGIN=${INTEGRATOR_ID} COMPANYID=${CUSTOMER_ID}" -Wait }
|
||||
Catch { LogErr $_.Exception.Message }
|
||||
|
||||
## Remove agent installer
|
||||
#Try { Remove-Item $AGENT_INSTALLER -Force }
|
||||
#Catch { LogErr $_.Exception.Message }
|
||||
|
||||
} Else { LogMsg "Atera agent is already installed on this endpoint." }
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
start "" /w msiexec /x {EFB51F01-9805-4293-BB16-6F17EF4CEDF2} /qn
|
||||
sc stop AteraAgent > nul 2> nul
|
||||
sc delete AteraAgent > nul 2> nul
|
||||
taskkill /f /im TicketingTray.exe > nul 2> nul
|
||||
REG DELETE "HKEY_CURRENT_USER\Software\ATERA Networks" /f > nul 2> nul
|
||||
RMDIR /S /Q "%userprofile%\appdata\local\temp\TrayIconCaching" > nul 2> nul
|
||||
taskkill /f /im AteraAgent.exe > nul 2> nul
|
||||
taskkill /f /im TicketingTray.exe > nul 2> nul
|
||||
taskkill /f /im AgentPackageMonitoring > nul 2> nul
|
||||
taskkill /f /im AgentPackageInformation > nul 2> nul
|
||||
taskkill /f /im AgentPackageRunCommandInteractive > nul 2> nul
|
||||
taskkill /f /im AgentPackageEventViewer.exe > nul 2> nul
|
||||
taskkill /f /im AgentPackageSTRemote.exe > nul 2> nul
|
||||
taskkill /f /im AgentPackageInternalPoller.exe > nul 2> nul
|
||||
taskkill /f /im AgentPackageWindowsUpdate.exe > nul 2> nul
|
||||
taskkill /f /im AgentPackageSystemTools.exe > nul 2> nul
|
||||
taskkill /f /im AgentPackageHeartbeat.exe > nul 2> nul
|
||||
taskkill /f /im AgentPackageUpgradeAgent > nul 2> nul
|
||||
taskkill /f /im AgentPackageProgramManagement > nul 2> nul
|
||||
taskkill /f /im AgentPackageRegistryExplorer.exe > nul 2> nul
|
||||
timeout /t 4 /nobreak >nul
|
||||
REG DELETE "HKEY_CURRENT_USER\Software\ATERA Networks" /f > nul 2> nul
|
||||
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\ATERA Networks" /f > nul 2> nul
|
||||
REG DELETE "HKEY_CLASSES_ROOT\Installer\Products\4758948C95C1B194AB15204D95B42292" /f > nul 2> nul
|
||||
REG DELETE "HKEY_CLASSES_ROOT\Installer\Products\10F15BFE50893924BB61F671FEC4DE2F" /f > nul 2> nul
|
||||
RMDIR /S /Q "C:\Program Files\ATERA Networks\AteraAgent" > nul 2> nul
|
||||
RMDIR /S /Q "C:\Program Files (x86)\ATERA Networks" > nul 2> nul
|
||||
|
||||
start "" /w msiexec /x {B7C5EA94-B96A-41F5-BE95-25D78B486678} /qn
|
||||
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Splashtop Inc." /f > nul 2> nul
|
||||
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Splashtop Inc." /f > nul 2> nul
|
||||
RMDIR /S /Q "C:\Program Files (x86)\Splashtop\Splashtop Remote\Server" > nul 2> nul
|
||||
RMDIR /S /Q "C:\ProgramData\Splashtop\Temp" > nul 2> nul
|
||||
sc stop "SplashtopRemoteService"
|
||||
sc delete "SplashtopRemoteService"
|
||||
sc stop "SSUService"
|
||||
sc delete "SSUService"
|
||||
RMDIR /S /Q "C:\ProgramData\Splashtop\Splashtop Software Updater" > nul 2> nul
|
||||
RMDIR /S /Q "C:\Program Files (x86)\Splashtop\Splashtop Software Updater" > nul 2> nul
|
||||
@@ -1,11 +0,0 @@
|
||||
If (Test-Path "${Env:ProgramFiles}\ATERA Networks\AteraAgent\unins000.exe")
|
||||
{
|
||||
Start-Process "${Env:ProgramFiles}\ATERA Networks\AteraAgent\unins000.exe" -ArgumentList "/SILENT" -Wait
|
||||
}
|
||||
If (Test-Path "${Env:ProgramFiles(x86)}\ATERA Networks\AteraAgent\unins000.exe")
|
||||
{
|
||||
Start-Process "${Env:ProgramFiles(x86)}\ATERA Networks\AteraAgent\unins000.exe" -ArgumentList "/SILENT" -Wait
|
||||
}
|
||||
If (Test-Path "${Env:ProgramFiles(x86)}\ATERA Networks") { Remove-Item "${Env:ProgramFiles(x86)}\ATERA Networks" -Recurse }
|
||||
If (Test-Path "${Env:ProgramFiles}\ATERA Networks") { Remove-Item "${Env:ProgramFiles}\ATERA Networks" -Recurse }
|
||||
If (Test-Path "HKLM:Software\ATERA Networks") { Remove-Item "HKLM:Software\ATERA Networks" -Recurse }
|
||||
Reference in New Issue
Block a user