Installing SCOM Agent (Microsoft Monitoring Agent) from System Center Virtual Machine Manager (SCVMM) using Run Script Command or Generic Command Execution (GCE)
On the Hyper-V host I can use the Run Script Command function to install the SCOM agent on the host (of course I can also use SCOM to push the agent, but that’s not what I wanted). From the use I can use the following:
The executable program is:
The parameters are:
/i MOMAgent.msi /qn USE_SETTINGS_FROM_AD=0 MANAGEMENT_GROUP=Demo MANAGEMENT_SERVER_DNS=VMserver05.demo.lab ACTIONS_USE_COMPUTER_ACCOUNT=1 USE_MANUALLY_SPECIFIED_SETTINGS=1 SET_ACTIONS_ACCOUNT=1 AcceptEndUserLicenseAgreement=1
With the parameter I specify the management group and the management server name. You could also use AD assigned management servers and other parameters.
The Script Resource Package is the folder where I copied the agent installation source in the VMM library. I also specified an installer account with the permissions to install software on the host.
After the job completed I get following entry in the VMM job log.
On the virtual machines, I can use GCEs to install the SCOM agent. This looks very similar to the Run Script Command.
In the Pre-install 2 step I configure the agent installation the same way as in the Run Script Command dialog box. This time however, the script gets executed in the VM. This can only be done in a Service Template, not in a VM Template. Therefore, you should always consider creating a Service Template, when designing a VM installation.
Configure the following as Executable program: cmd.exe
And as Parameters use: /q /c %WinDir%\System32\msiexec.exe /i MOMAgent.msi /l*v c:\log\scomagent.txt /qn USE_SETTINGS_FROM_AD=0 MANAGEMENT_GROUP=Demo MANAGEMENT_SERVER_DNS=vmserver05.demo.lab ACTIONS_USE_COMPUTER_ACCOUNT=1 USE_MANUALLY_SPECIFIED_SETTINGS=1 SET_ACTIONS_ACCOUNT=1 AcceptEndUserLicenseAgreement=1
Here I can reuse the same Script resource package that was used in the Run Script Command and I am using the same run as account.
For more tips on VMM service deployment see: http://blogs.technet.com/b/scvmm/archive/2011/05/17/scvmm-vmm-2012-service-deployment-troubleshooting-tips.aspx