Install OpsMgr Agent-less remotely with Powershell

less than 1 minute read

In our previous post we installed the OpsMgr agent remotely with Poweshell and enabled agent proxying. Now we are going to monitor a server agentless via Powershell:

[xml]

#=======================================================================
#

NAME: Opsmgr 2012 Agent-less Install

#

AUTHOR: Alexandre Verkinderen

DATE  : 10/23/2013

#
#Requirements: The Operations Manager Powershell module needs to be installed
#

COMMENT: This script is designed to install OpsMgr 2012 agent-less

The following need agent-less installation using default options: Add-SCOMAgentlessManagedComputer http://technet.microsoft.com/en-us/library/hh918462.aspx : SCDPM01, SCCM01

#=======================================================================

#Variables
$MS = “SCOM01.contoso.com”

invoke-command -ComputerName $MS{
$AgentList = @(“scdpm01.contoso.com”,”sccm01.contoso.com”)
$MS = “SCOM01.contoso.com”

#Import PowerShell Modules
import-module OperationsManager
#Connect to OpsMgr Management Group
New-SCOMManagementGroupConnection -ComputerName $MS

#————————————————————–
#OpsMgr Agent Installation
#———————————–

Foreach($Agent in $AgentList)
{

Add-SCOMAgentlessManagedComputer -Name $Agent -ManagedByManagementServer (Get-SCOMManagementserver -Name $MS)

}
}

[/xml]

Thanks,

Alexandre Verkinderen

Leave a comment