AutoElevate Deploy

ChrisA_NIM
ChrisA_NIM Member Posts: 2
edited December 2023 in Scripts

Anyone have a working script to deploy the AE agent via Atera.? I've been working on the syntax unsuccessfully. The installer is an MSI only.

Tagged:

Comments

  • tanderson
    tanderson Member Posts: 273 ✭✭✭✭

    @ChrisA_NIM Here is an example of what the installation command might look like (assuming the AESetup.msi file is located in the “C:\Downloads” folder) for a silent unattended installation and to make a log file called AEInstallLog:

    msiexec /i C:\Downloads\AESetup.msi /quiet /lv AEInstallLog.log LICENSE_KEY="123456789ABCDEFGYOURLICENSEKEYHERE" COMPANY_NAME="Contoso, Inc." COMPANY_INITIALS="CI" LOCATION_NAME="Main Office" AGENT_MODE="live"

    You can create a download script like this using Onedrive or SharePoint, for example:

    $url = "https://example.com/file.zip" # Replace with your URL
    $output = "C:\path\to\file.zip" # Replace with your desired file path

    Invoke-WebRequest -Uri $url -OutFile $output

    You can make your own file location with this script if you want:

    New-Item "C:NameOfFolder" -Type Directory

  • tanderson
    tanderson Member Posts: 273 ✭✭✭✭

    @ChrisA_NIM If you want your own location run that script first. Then run the download script. Then the install.

  • ChrisA_NIM
    ChrisA_NIM Member Posts: 2

    Thanks. My issues is I can upload the msi via atera "upload script" with arguments and it will auto run the msiexec command but it's not executing correctly. I only have this issue with MSI files, exe files execute flawlessly via atera upload script (SentinelOne CyberCNS, etc) . So I'm looking having to create a download repository to download from like your SharePoint example but I really don't want and unsecured download source with my agents. Otherwise I'm going to have to upload the msi to every device manually.

    I currently do this with my Axcient msi's where I have to download the agent to a common location then run the per customer script to install just like your example msiexec /i C:\Downloads\AESetup.msi /quiet /lv AEInstallLog.log

  • kim
    kim Member Posts: 113 ✭✭✭

    Hi @ChrisA_NIM, would chocolatey help in this instance? I haven't had to use it before because most of my stuff are exe files, but I completely agree with you that posting it to an unsecured location poses a lot of security risks.

  • derek
    derek Member Posts: 37 ✭✭✭

    @ChrisA_NIM What do you think of AutoElevate ? Did you look at alternatives?

    I am thinking of deploying this to our clients machines.

  • Arbroath_d
    Arbroath_d Member Posts: 2
    edited January 12

    I put the AESetup.msi file in OneDrive and created a public link for it (don't forget "download=1" on the end of the link so the MSI downloads via the link rather than trying to display as a web page) - I then run a script within Atera (which I adapted based on some examples) which takes the Atera Company name of the client and adds to, or creates, a group of the same name at AutoElevate, it works really well.

    I'm not really worried about the AE MSI being on a public link as it's a generic install file.

    $AteraAPIKey = 'xxxxxxxxxxxxx'

    The download location to obtain the AutoElevate MSI file from

    $AESetupURI = 'xxxxxxxxxx'

    Your Autoelevate Licence Key

    $AELicenseKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

    The filename of the MSI which will be downloaded.

    $MSIFilename = 'AESetup.msi'

    #############################################

    Install and load the right version of Atera

    Find-Package -Name 'Nuget' -ForceBootstrap -IncludeDependencies
    if (!(Get-Module -ListAvailable PSAtera)) {
    Install-Module -Name PSAtera -MinimumVersion 1.3.1 -Force
    }
    Import-Module -Name PSAtera -MinimumVersion 1.3.1

    Set-AteraAPIKey -APIKey $AteraAPIKey

    Get the agent information for the PC that's running the script

    $agent = Get-AteraAgent

    Get the value from the Customer endpoint

    $AECompanyName = $(Get-AteraCustomer -CustomerID $agent.CustomerID).CustomerName
    $AEInitials = -join ($AECompanyName.ToCharArray() | Select-Object -First 2)

    Download AutoElevate Installer to temp path

    $AESetupMSI = Join-Path -Path $env:TEMP -ChildPath $MSIFilename
    Invoke-WebRequest -Uri $AESetupURI -OutFile $AESetupMSI

    (Start-Process "msiexec.exe" -ArgumentList "/i $AESetupMSI /quiet /lv AEInstallLog.log LICENSE_KEY=""$AELicenseKey"" COMPANY_NAME=""$AECompanyName"" COMPANY_INITIALS=""$AEInitials"" LOCATION_NAME=""Automatic"" AGENT_MODE=""audit""" -NoNewWindow -Wait -PassThru).ExitCode

  • SchleebJuice
    SchleebJuice Member Posts: 1

    I was able to figure this out.

    Create UPLOAD SCRIPT and the upload the Autoelevate MSI and use the argument which you can get from their site

    /quiet /lv AEInstallLog.log LICENSE_KEY="yoursitekey" COMPANY_NAME="your company name" COMPANY_INITIALS="yourinitials" LOCATION_NAME="yourlocation" AGENT_MODE="audit"