Solved

Automox groups

  • 7 May 2023
  • 4 replies
  • 101 views

Badge

Is there a powershell script that is already been established where i can install autmox and have it run with the our Key and assign it to a special group that is already been created. 

icon

Best answer by JohnG-Automox 8 May 2023, 18:06

View original

4 replies

Userlevel 3

Hi @jscafidi!

Here is a a Powershell script that should help!

https://help.automox.com/hc/en-us/articles/5384338960020#DeployingtheAutomoxAgentinBulk-DeployingonWindowsUsingPowerShell

When using it to deploy the Automox agent, you’ll want to call the ps1 file and pass your access key and target group parameters to it. 

Example:

Install-AxAgentMsi.ps1 -AccessKey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -GroupName "Target Group"

 

If the target group is nested beneath another group, you’ll want to ensure that you pass the -ParentGroupName as well:

Install-AxAgentMsi.ps1 -AccessKey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -GroupName "Target Group" -ParentGroupName "Windows Devices"

 

Let me know if you have any other questions!

 

Badge

Hey JohnG, this is what i have so it downloads it to the VMDIT folder but it doesnt install. am i doing something wrong.  The Parent group is “Default” and then group name i have in console is called AWS workspaces

 

$installpath = "C:\Program Files (x86)\Automox"
if(test-path $installpath) {
    write-host "exiting"
    exit
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$path = "C:\VMDIT\"
if(!(test-path $path)) {
    New-Item -ItemType Directory -Force -Path $path
}

Invoke-WebRequest -Uri "https://console.automox.com/Automox_Installer-latest.msi" -OutFile "C:\VMDIT\Automox_Installer-latest.msi"

Start-Process msiexec.exe -Wait -ArgumentList '/i C:\VMDIT\Automox_Installer-latest.msi /qn /norestart ACCESSKEY=XXXXXXXXXXXXX -GroupName "AWS Workspaces” -ParentGroupName “Default”

Userlevel 3

Hi @jscafidi,


It looks like the deployment method you are using is downloading the Automox msi, and then invoking it directly.  This method is completely separate from the Powershell script I sent earlier.

 

That being said, I see two issues with your current script.

  1. The Automox installer URL in your Invoke-WebRequest command is incorrect.
  1. You are passing the -GroupName and -ParentGroupName parameters to the MSI, but these parameters only exist with the aforementioned Powershell deployment method. When using the MSI, you’ll want to pass the GROUP parameter instead: https://help.automox.com/hc/en-us/articles/5352260844564-Silent-Agent-Deployment-on-Windows


Here’s a revised script that will correct those issues:
 

$installpath = "C:\Program Files (x86)\Automox"
if(test-path $installpath) {
write-host "exiting"
exit
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$path = "C:\VMDIT\"
if(!(test-path $path)) {
New-Item -ItemType Directory -Force -Path $path
}

Invoke-WebRequest -Uri "https://console.automox.com/installers/Automox_Installer-latest.msi" -OutFile "C:\VMDIT\Automox_Installer-latest.msi"

Start-Process -FilePath 'msiexec.exe' -ArgumentList ('/i','C:\VMDIT\Automox_Installer-latest.msi','/qn','/norestart','ACCESSKEY="XXXX-XXXX-XXXX-XXXX"','GROUP="Default Group/AWS Workspaces"')

 

Let me know if you still have issues!

Badge

Thank you!!

Reply