In this short post I’ll cover how to install OMS agent on a Server Core instance.
The first step is to download and extract the installer. This step must be performed on a machine with the Windows GUI installed, Server Core instances won’t work. To extract the installer run:
MMASetup-AMD64.exe /c [/t:ExtractPath]
The /t parameter is optional, you will be prompted to specify the extraction path in the GUI if it wasn’t specified.
To install OMS agent on a Server Core instance you have to run the installer silently by passing the /qn switch along with some other bits of information required by OMS.
See the example PowerShell script below:
$WorkSpaceID = "xxxxxx" $WorkSpaceKey="xxxxx==" $ArgumentList = ' /qn ADD_OPINSIGHTS_WORKSPACE=1 ' + "OPINSIGHTS_WORKSPACE_ID=$WorkspaceID " + "OPINSIGHTS_WORKSPACE_KEY=$WorkSpaceKey " + 'AcceptEndUserLicenseAgreement=1' Start-Process '.\setup.exe'-ArgumentList $ArgumentList-ErrorAction Stop -Wait -Verbose |Out-Null
Get-WmiObject -Query 'select * from win32_product where Name = "Microsoft Monitoring Agent"'
$agent = Get-WmiObject -Query 'select * from win32_product where Name = "Microsoft Monitoring Agent"' $agent.Uninstall()