Skip to content

Instantly share code, notes, and snippets.

@ebibibi
Created July 6, 2021 04:16
Show Gist options
  • Save ebibibi/86e2aa83fc2c07ed3fcd2a6efc857a1d to your computer and use it in GitHub Desktop.
Save ebibibi/86e2aa83fc2c07ed3fcd2a6efc857a1d to your computer and use it in GitHub Desktop.
sample code for install MMA agent to windows server silently
param (
[Parameter(mandatory=$true)] $MMAInstallerURI,
[Parameter(mandatory=$true)] $WorkSpaceID,
[Parameter(mandatory=$true)] $Key
)
#donwload
Invoke-WebRequest -UseBasicParsing -URI $MMAInstallerURI -OutFile .\MMASetup-AMD64.exe
#extract
.\MMASetup-AMD64.exe /c /t:c:\mmasetup
#install
c:\mmasetup\setup.exe /qn NOAPM=1 ADD_OPINSIGHTS_WORKSPACE=1 OPINSIGHTS_WORKSPACE_AZURE_CLOUD_TYPE=0 OPINSIGHTS_WORKSPACE_ID="$WorkSpaceID" OPINSIGHTS_WORKSPACE_KEY="$Key" AcceptEndUserLicenseAgreement=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment