Install SCOM Agent Using Command Line

Prajwal Desai
Posted by Prajwal Desai

Install SCOM Agent Using Command Line

Install SCOM Agent Using Command Line – After installing SCOM 2012 SP1, we saw how to install the SCOM agent on windows based computers. In this post we will see the steps to install SCOM agent using command line, to install SCOM agent using command line we will make use of MOMAgent.msi and this is also referred to as manual installation of SCOM agent. Before you install SCOM agent using command line, here are few things that needs to be considered.

 

Read this once as its very Important

1) The account that is used to run MOMAgent.msi must have administrative privileges on the computers on which you are installing agents. In this post we will be using scomadmin as the user account to install the SCOM agent using command line and this account is a member of domain admins group.

2) By default the management server does not accept the manual installation of SCOM agent, if you install the agent manually it will not be displayed in the operations manager console. So we must configure our management group or single management server to accept agents installed with MOMAgent.msi. If the SCOM agent is installed manually then you must configure the management server to accept manually installed agents, the agents will display in the console after approximately one hour. So its recommended that you first configure management server to accept manual installation of clients and then install the clients manually.

Can I Install SCOM agent on my domain controller ? – Yes, you can install the SCOM agent on your domain controller, I would recommend you to install the SCOM agent through discovery wizard. If you are planning to install the SCOM agent on domain controller manually then install the SCOM agent on domain controller and then you must install the Active Directory management pack helper object by running the file OomADs.msi on domain controller, this will prevent errors that might occur during deployment of the management pack. The OomADs.msi file can be found on the management server and the path is C:Program FilesSystem Center 2012Operations ManagerServerHelperObjects. If you are using discovery wizard to install the agent on domain controller then the Active Directory Management Pack helper object is automatically installed.

So our first step to install SCOM agent using command line would be to allow the management server to accept the manual installation of SCOM agents. If you have more than one Management Servers in your organization then you can configure manual agent installation settings for a management group through global configuration. To do so click on Administration, in the Administration workspace, expand Administration, expand Settings, expand Type: Server, right-click Security, and then click on Properties. By default manual agent installations are rejected, click on Review new manual agent installations in pending management view and select Auto-approve new manually installed agents. With this setting enabled, manual installation of SCOM 2012 SP1 agents are accepted by management server.

SCOM 2012 agent

 

If you have a single Management Server then proceed with the below steps to allow management server to accept the manual installation of agents. Launch the Operations Manager console, click on Administration workspace, expand Administration, expand Device Management, and then right click Management Servers click on Properties. On the Management Server properties window, click on Security tab and note the default settings. We see that manual agent installations are rejected by Management server, this is the most secure setting and is selected by default.

Let’s go through each of the options listed here :-

1) Reject new manual agent installations – All manually installed agents are rejected by Operations Manager. As per Microsoft this is the most secure setting and is selected by default. So if you are using Discovery Wizard to install clients on windows computers then you need not worry about this option.

2) Review new manual agent installations in pending management view – If this option is selected then all requests from a manually installed agent will be directed to Pending Management before being allowed to join the management group. An administrator must review the request and manually approve the agents’ request.

3) Auto-approve new manually installed agents – This option is available only if Review new manual agent installations in pending management view has been selected. This setting causes Operations Manager to automatically allow any manually installed agent to join the management group.

 

SCOM 2012 agent

 

On the Security tab click on Override global Management Server settings and then select Review new manual agent installations in pending management view and select Auto-approve new manually installed agents. With these settings we are allowing the manual agent installations and allowing it to join the Management group automatically. Click on Apply and OK.

 

SCOM agent 2012 SP1

 

Now after completing the above steps the next step is to install SCOM agent using command line. We will install the SCOM agent on a client machine named CLIENT.PRAJWAL.LOCAL which has windows 7 professional 64 bit OS installed and running. Log on to the computer where you want to install the agent by using an account with local administrator privileges and open command prompt.

The syntax of the command to install SCOM agent using command line is

%WinDir%System32msiexec.exe /i pathDirectoryMOMAgent.msi /qn USE_SETTINGS_FROM_AD={0|1} USE_MANUALLY_SPECIFIED_SETTINGS={0|1} MANAGEMENT_GROUP=MGname MANAGEMENT_SERVER_DNS=MSname MANAGEMENT_SERVER_AD_NAME =MSname SECURE_PORT=PortNumber ACTIONS_USE_COMPUTER_ACCOUNT={0|1} ACTIONSUSER=UserName ACTIONSDOMAIN=DomainName ACTIONSPASSWORD=Password AcceptEndUserLicenseAgreement=1

%WinDir%System32msiexec.exe /i – Path of msiexec.exe. /i is the switch to install or configure the product.

pathDirectoryMOMAgent.msi /qn – Path of MOMAgent.msi, /qn is to hide the user interface.

USE_SETTINGS_FROM_AD={0|1} – Set USE_SETTINGS_FROM_AD= to 0 if you want to set the properties at the command line. Set to 1 to use the management group settings from Active Directory.

USE_MANUALLY_SPECIFIED_SETTINGS={0|1} – 
Set USE_MANUALLY_SPECIFIED_SETTINGS= to 1 if you want to specify the manual settings for client installation, else set to 1 to take settings from AD.

MANAGEMENT_GROUP=MGname – Specify the management group that will manage the computer.

MANAGEMENT_SERVER_DNS=MSname – Specify the fully qualified domain name for the management server.

MANAGEMENT_SERVER_AD_NAME =MSname – Specify the FQDN of the management server.

SECURE_PORT=PortNumber – Specify the port number here. You can ignore this option. The port number used should be 5723.

ACTIONS_USE_COMPUTER_ACCOUNT={0|1} – If you are using specified user account then use “0” or use “1” if you are using the Local System account to deploy SCOM agent.

ACTIONSUSER=UserName – If you are using specific user account then set the user name here. (The user account must have enough privileges to install SCOM agent on a computer).

ACTIONSDOMAIN=DomainName – Sets the domain for the Agent Action account identified with the ACTIONSUSER parameter.

ACTIONSPASSWORD=Password – The password for the user account used for deploying scom agent.

AcceptEndUserLicenseAgreement=1 – This means you accept End user license agreement.

 

Before you execute the command we will first copy the Agent installation file (MOMAgent.msi) to a folder on the client desktop. An other option would be that you can share the installation path on the SCOM server and use it for installation. The agent setup file can be found in the SCOM installation source, inside it there will be folder named agent which will include agent installation files for 64 bit, 32 bit and Itanium based computers. We will copy AMD64 folder on clients desktop.

 

Install SCOM Agent Using Command Line

On the client machine, launch the command prompt, change the path to AMD64 folder where agent installation files are present and execute the below command.

msiexec.exe /i MOMAgent.msi /qn USE_SETTINGS_FROM_AD=0 MANAGEMENT_GROUP=SCOM-GROUP MANAGEMENT_SERVER_DNS=SCOM.PRAJWAL.LOCAL MANAGEMENT_SERVER_AD_NAME=SCOM.PRAJWAL.LOCAL ACTIONS_USE_COMPUTER_ACCOUNT=1 USE_MANUALLY_SPECIFIED_SETTINGS=1 AcceptEndUserLicenseAgreement=1

 

Install SCOM Agent Using Command Line

After few minutes, on the client machine you will find the new entry Operations Manager Agent in control panel. Click on Operations Manager Agent and under agent properties you will see the name of the SCOM Management group, Primary Management Sever, Port number, Assignment type, Agent Action. Note that we had installed the agent manually so the assignment is set to manual and agent action is Local system because we have logged with local administrator account and installed the SCOM agent.

 

Install SCOM Agent Using Command Line Snap 6

Now lets open the Operations Manager console and see whats the status of SCOM agent installed on client machine. Click on Administration and click on Agent Managed. We see that CLIENT.PRAJWAL.LOCAL machine entry is seen but the client health state status is Not Monitored. Wait for few minutes while Operations Manager collects information about the client machine through the agent.

Install SCOM Agent Using Command Line

After waiting for few minutes we see the Health State is changed to Healthy. Please wait while rest of the information about the client machine is being collected.

Install SCOM Agent Using Command Line

 

After waiting for few more minutes we see that more information about the client machine is displayed which includes the FQDN, Name of the client machine, Domain name, SCOM agent version.

Install SCOM Agent Using Command Line

We have installed the SCOM agent thorough command line and the process has been successful. In the coming posts we will see more on configuring SCOM server and explore various options. Thanks for reading the post and I hope this post has helped you.

Share This Article
Prajwal Desai
Posted by Prajwal Desai
Follow:
Prajwal Desai is a Microsoft MVP in Intune and SCCM. He writes articles on SCCM, Intune, Windows 365, Windows Server, Windows 11, WordPress and other topics, with the goal of providing people with useful information.
7 Comments