작업 관리자 관리 팩를 제거 하는 방법

 

게시: 2016년 3월

적용 대상: System Center 2012 R2 Operations Manager, System Center 2012 - Operations Manager, System Center 2012 SP1 - Operations Manager

관리 팩이 더 이상 필요 운영 콘솔을 사용 하 여 삭제할 수 없습니다. 관리 팩을 삭제 하면 모든 설정 및 연결 된 임계값에서 제거 됩니다 System Center 2012 - Operations Manager합니다. 또한 해당 관리 팩에 대 한.mp 또는.xml 파일이 관리 서버의 하드 디스크에서 삭제 됩니다. 종속 된 관리 팩을 먼저 삭제 한 경우에 관리 팩을 삭제할 수 있습니다.

관리 팩을 제거 하려면

  1. Operations Manager 관리자 역할의 구성원인 계정으로 컴퓨터에 로그온합니다.

  2. 운영 콘솔에서 관리를 클릭합니다.

  3. 관리, 를 클릭 하 여 관리 팩.

  4. 관리 팩 창에서 사용자 관리 팩을 마우스 오른쪽 단추로 클릭 하려는 제거 하 고 클릭 한 다음 삭제합니다.

  5. 내용의 메시지는 관리 팩을 삭제 영향을 줄 수 일부 사용자 역할의 범위 지정, 클릭 합니다.

프로그래밍 방식으로 종속성이 있는 관리 팩을 제거 합니다.

관리 팩은 UI의 관리 창에서 삭제 되 면 수 매우 많은 시간이 재귀적으로 추적 하 고 원래 의도 한 관리 팩을 삭제 하기 전에 모든 종속 관리 팩을 삭제 합니다. 관리 팩 및 모든 종속 계단식 삭제 하려면 다음 스크립트를 사용할 수 있습니다.

스크립트를 실행 하려면 다음이 단계를 따르십시오.

  1. 관리자 모드에서 Operations Manager 명령 셸 프롬프트를 엽니다.

  2. 여기서 디스크에 저장 한 디렉터리에서 연결 된 스크립트를 실행 합니다. 예를 들면 다음과 같습니다.

    • .\RecursiveRemove.ps1 < ID 또는 MP의 시스템 이름 >

    • .\RecursiveRemove.ps1 Microsoft.SQLServer.2014.Discovery

    참고 ID 또는에서 선택 하 여 제거 하려는 MP의 시스템 이름을 확인할 수 있습니다 설치 된 관리 팩 보기. 클릭 한 다음 속성 작업 창에서. 다음의 콘텐츠를 복사 ID: 텍스트 상자 탭이 일반적입니다.

# The sample scripts are not supported under any Microsoft standard support 
# program or service. The sample scripts are provided AS IS without warranty 
# of any kind. Microsoft further disclaims all implied warranties including, 
# without limitation, any implied warranties of merchantability or of fitness
# for a particular purpose. The entire risk arising out of the use or 
# performance of the sample scripts and documentation remains with you. In no
# event shall Microsoft, its authors, or anyone else involved in the creation,
# production, or delivery of the scripts be liable for any damages whatsoever
# (including, without limitation, damages for loss of business profits,
# business interruption, loss of business information, or other pecuniary
# loss) arising out of the use of or inability to use the sample scripts or
# documentation, even if Microsoft has been advised of the possibility of 
# such damages.
# PowerShell script to automagically remove an MP and its dependencies.
# Original Author   :       Christopher Crammond
# Modified By       :       Chandra Bose
# Date Created      :   April 24th, 2012
# Date Modified     :   Januray 18th, 2016
# Version       :       0.0.2

# Needed for SCOM SDK
$ipProperties = [System.Net.NetworkInformation.IPGlobalProperties]::GetIPGlobalProperties()
$rootMS = "{0}.{1}" -f $ipProperties.HostName, $ipProperties.DomainName


#######################################################################
# Helper method that will remove the list of given Management Packs.
function RemoveMPsHelper 
{param($mpList)
  foreach ($mp in $mpList)
  {
    $recursiveListOfManagementPacksToRemove = Get-SCOMManagementPack -Name $mp.Name -Recurse
    if ($recursiveListOfManagementPacksToRemove.Count -gt 1)
    {
        Echo "`r`n"
        Echo "Following dependent management packs has to be deleted before deleting $($mp.Name)..."

        $recursiveListOfManagementPacksToRemove | format-table name
        RemoveMPsHelper $recursiveListOfManagementPacksToRemove
    }
    else
    {
        $mpPresent = Get-ManagementPack -Name $mp.Name
        $Error.Clear()
        if ($mpPresent -eq $null)
        {
            # If the MP wasn’t found, we skip the uninstallation of it.
            Echo "    $mp has already been uninstalled"
        }
        else
        {
            Echo "    * Uninstalling $mp "
            Uninstall-ManagementPack -managementpack $mp
        }
    }
  }
}

#######################################################################
# Remove 'all' of the JEE MPs as well as MPs that are dependent on them.
# The remove is done by finding the base MP (Microsoft.JEE.Library) and finding
# all MPs that depend on it.  This list will be presented to the user prompting
# if the user wants to continue and removing the list of presented MPs
function RemoveMPs
{param($mp)

  $listOfManagementPacksToRemove = Get-SCOMManagementPack -Name $mp -Recurse
  $listOfManagementPacksToRemove | format-table name

  $title = "Uninstall Management Packs"
  $message = "Do you want to uninstall the above $($listOfManagementPacksToRemove.Count) management packs and its dependent management packs"

  $yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes", "Uninstall selected Management Packs."
  $no = New-Object System.Management.Automation.Host.ChoiceDescription "&No", "Do not remove Management Packs."
  $options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)

  $result = $host.ui.PromptForChoice($title, $message, $options, 0) 

  switch ($result)
  {
        0 {RemoveMPsHelper $listOfManagementPacksToRemove}
        1 {"Exiting without removing any management packs"}
  }
}

#######################################################################
# Begin Script functionality
if ($args.Count -ne 1)
{
  Echo "Improper command line arguments"
  Echo ""
  Echo "Specify a command line argument to either import or export MPs"
  exit 1
}
else
{
  $firstArg = $args[0]

  add-pssnapin "Microsoft.EnterpriseManagement.OperationsManager.Client";
  $cwd = get-location
  set-location "OperationsManagerMonitoring::";
  $mgConnection = new-managementGroupConnection -ConnectionString:$rootMS;

  RemoveMPs $firstArg

  set-location $cwd
  remove-pssnapin "Microsoft.EnterpriseManagement.OperationsManager.Client";  
}

참고

다른 가져온된 관리 팩을 제거 하려는 관리 팩에 종속 되어 있는 경우는 종속 관리 팩 오류 메시지가 표시 됩니다. 계속 하기 전에 종속 된 관리 팩을 제거 해야 합니다.

Operations Manager에서 선택한 관리 팩을 제거합니다.