달력

5

« 2024/5 »

  • 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

'Opertions Manager 2007'에 해당되는 글 1

  1. 2009.08.05 Active Diretory의 특정 컴퓨터 그룹에 대해 SCOM Agent 설치 (Discovery & Install)

param ($rootMS,$Domain,$targetmS,$targetAgent)
#Checking Root MS parameter
     if ($rootMS -eq $null) {
        Write-Host ""
        Write-Host "SYNTAX:";
        Write-Host ""
        Write-Host "-rootMS: FQDN of the root management server for the target management group.";
        Write-Host "Ex: RootManagementServer.fqdn.local";
        Write-Host ""
        Write-Host "-Domain: The target group.  Use the display name of the group.";
        Write-Host "Ex: 'NOC Computers Test";
        Write-Host ""
        Write-Host "-targetMS: FQDN of the management server for discovery, install and agent mgmt.";
        Write-Host "Ex: 'MyMS.fqdn.local'"
        Write-Host ""
        Write-Host "-targetAgent: FQDN of the server on which agent(s) should be installed (wildcards allowed).";
        Write-Host "Ex: 'Computer.fqdn.local'"
        Write-Host ""
 exit;
     }

#Initialize the OpsMgr Provider
Add-PSSnapin Microsoft.EnterpriseManagement.OperationsManager.Client

# Set the location to the root of the provider namespace.
cd OperationsManagerMonitoring::

#create a connection to the Management Group
New-ManagementGroupConnection $rootMS

#change the path
cd $rootMS

#configure query setting based on your -targetMS parameter input
$ldap_query = new-ldapquerydiscoverycriteria -domain $Domain '
 -ldapquery "(sAMAccountType=805306369)(name=$targetAgent*)"

#configure discovery setting
$windows_discovery_cfg = new-windowsdiscoveryconfiguration -ldapquery $ldap_query

# discoveryresults
$discovery_results = start-discovery -managementserver (get-managementserver | '
where {$_.Name -eq "$targetMS"}) -windowsdiscoveryconfiguration $windows_discovery_cfg

#install Agent(s) based on the criteria of your search in the -targetMS parameter
install-agent -managementserver (get-managementserver | where {$_.Name -eq "$targetMS"}) '
-agentmanagedcomputer $discovery_results.custommonitoringobjects

:
Posted by 커널64