동기화를 시작하는 방법

Asset Intelligence 카탈로그는 일반 동기화 일정을 벗어나 수동으로 새로 고칠 수 있습니다. 수동 새로 고침은 SMS_AIProxy 서버 WMI 클래스RequestCatalogUpdate 메서드를 사용하여 수행됩니다.

중요

이 메서드는 12시간 내에 한 번만 호출할 수 있으며 후속 메서드 호출은 작동하지 않습니다.

Asset Intelligence 카탈로그 새로 고침

  1. SMS 공급자에 대한 연결을 설정합니다. 자세한 내용은 SMS 공급자 기본 사항을 참조하세요.

  2. 카탈로그를 새로 고치려는 SMS_AIProxy 인스턴스에 대해 SMS 공급자를 쿼리합니다.

  3. SMS_AIProxy 클래스 RequestCatalogUpdate 메서드를 호출하여 컬렉션에 대한 작업을 실행합니다.

예시

다음 예제 메서드는 제공된 서버에서 새로 고침을 실행합니다.

샘플 코드 호출에 대한 자세한 내용은 코드 조각 Configuration Manager 호출을 참조하세요.

Function InitiateSync(connection, serverName)
    On Error Resume Next    
    Dim classObj: Set classObj = connection.Get("SMS_AIProxy")    
    Dim inParams: Set inParams = classObj.Methods_("RequestCatalogUpdate").InParameters.SpawnInstance_()
    Dim outParams
    inParams.Properties_.Item("ProxyName") = serverName
    Set outParams = connection.ExecMethod("SMS_AIProxy", "RequestCatalogUpdate", inParams)
    If Err.Number <> 0 Then
        InitiateSync = False
    Else
        InitiateSync = True
    End If
    On Error Goto 0
End Function  
public void InitiateSync(WqlConnectionManager connection, string serverName)
{
    try
    {        
        Dictionary<string, object> inParams = new Dictionary<string, object>();
        IResultObject classObj = connection.GetClassObject("SMS_AIProxy");
        inParams.Add("ProxyName", serverName);
        Console.WriteLine("Requesting catalog update on server " + serverName);
        classObj.ExecuteMethod("RequestCatalogUpdate", inParams);    
    }    
    catch (SmsException ex)    
    {        
        Console.WriteLine(String.Format("Failed to request catalog update on server {0}. Error: {1}", serverName, ex.Message));           
        throw;    
    }
}  

예제 메서드에는 다음 매개 변수가 있습니다.

매개 변수 형식 설명
연결 관리: WqlConnectionManager

VBScript: SWbemServices
공급자에 대한 유효한 연결입니다.
Servername 관리: String

Vbscript: String
새로 고침을 실행할 서버의 이름입니다. 이 이름은 인스턴스의 ProxyName 속성에 SMS_AIProxy 매핑됩니다.

코드 컴파일

C# 예제에는 다음이 필요합니다.

네임 스페이스

시스템

System.Collections.Generic

System.Text

Microsoft. ConfigurationManagement.ManagementProvider

Microsoft. ConfigurationManagement.ManagementProvider.WqlQueryEngine

어셈블리

microsoft.configurationmanagement.managementprovider

adminui.wqlqueryengine

강력한 프로그래밍

오류 처리에 대한 자세한 내용은 Configuration Manager 오류 정보를 참조하세요.

.NET Framework 보안

Configuration Manager 애플리케이션 보안에 대한 자세한 내용은 역할 기반 관리 Configuration Manager 참조하세요.