달력

1

« 2025/1 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

Agent Failover를 사용하기 위해서는 AD 통합이 되어야 하는데
AD 통합이 되어 있지 않은 상태에서 Agent Failover를 구성하기 위해서는 다음 스크립트를 사용한다.

param($agentComputerName,$failoverManagementServerName)
$agent = get-agent | where {$_.PrincipalName -eq $agentComputerName}
$primaryManagementServer  = $agent.GetPrimaryManagementServer();
if($primaryManagementServer -eq $null)
{
"Primary management server not found"
return
}
$failoverManagementServer = Get-ManagementServer | where {$_.PrincipalName -eq $failoverManagementServerName}
if($failoverManagementServer -eq $null)
{
"Failover management server not found"
return
}
if($failoverManagementServer.PrincipalName -eq $primaryManagementServer.PrincipalName)
{
"The failover management server cannot be the same as the primary management server"
return
}
$failoverServers = New-Object System.Collections.Generic.List``1"[[Microsoft.EnterpriseManagement.Administration.ManagementServer,Microsoft.EnterpriseManagement.OperationsManager,Version=6.0.4900.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35]]"
$failoverServers.Add($failoverManagementServer)
$agent.SetManagementServers($primaryManagementServer,$failoverServers)

== 사용 방법 ==
1. 위 스크립트를 PS1 확장자로 저장
2. OpsMgr Command Shell 실행
3. 다음과 같이 Agent의 Failover 설정
<SavedFileName>.ps1 -agentComputerName:'agent1.contoso.com'  -failoverManagementServerName:'scommgmt.contoso.com'

:
Posted by 커널64