드라이버에 대해 지원되는 플랫폼을 지정하는 방법

Configuration Manager 드라이버의 SMS_Driver Server WMI 클래스 개체의 속성 XML에 SDMPackageXML 드라이버의 지원되는 플랫폼을 지정합니다. XML에는 드라이버가 지원하는 각 플랫폼에 대한 요소를 추가하는 PlatformApplicabilityCondition 노드 PlatformApplicabilityConditions 가 포함되어 있습니다.

참고

SMS_SupportedPlatforms Server WMI 클래스 개체에 나열된 플랫폼만 추가해야 합니다. 드라이버는 주요 운영 체제 릴리스에 대해서만 조건화할 수 있습니다. 즉, 서비스 팩에서 드라이버를 대상으로 지정할 수 없습니다.

주의

SDMPackageXML 지원되는 플랫폼 부분은 편집할 수 있는 CI-XML 스키마의 유일한 부분입니다. XML의 다른 부분을 변경하면 안 됩니다.

다음 XML은 두 플랫폼을 지원하는 드라이버를 보여 줍니다. 지원되는 플랫폼 스키마에 대한 자세한 내용은 운영 체제 배포 드라이버 지원 플랫폼 스키마를 참조하세요.

<PlatformApplicabilityConditions>  
    <PlatformApplicabilityCondition DisplayName="All x64 Windows XP Professional" MaxVersion="5.20.9999.9999" MinVersion="5.20.3790.0" Name="Win NT" Platform="x64">  
        <Query1>SELECT * FROM Win32_OperatingSystem WHERE BuildNumber = '3790' AND OSType=18 AND ProductType=1</Query1>   
        <Query2>SELECT * FROM Win32_Processor WHERE Architecture=9 AND DataWidth=64</Query2>   
        </PlatformApplicabilityCondition>  
    <PlatformApplicabilityCondition DisplayName="All x86 Windows 2000" MaxVersion="5.00.9999.9999" MinVersion="5.00.0000.0" Name="Win NT" Platform="I386">  
        <Query1>SELECT * FROM Win32_OperatingSystem WHERE BuildNumber = '2195' AND OSType=18 AND ServicePackMajorVersion >= 4</Query1>   
        <Query2>SELECT * FROM Win32_Processor WHERE Architecture=0</Query2>   
    </PlatformApplicabilityCondition>  
</PlatformApplicabilityConditions>  

플랫폼 적용 가능성 요구 사항의 유효성을 검사하려면 필요한 플랫폼에 SMS_SupportedPlatforms Server WMI 클래스 클래스 Condition 속성을 사용합니다.

드라이버에 대해 지원되는 플랫폼을 지정하려면

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

  2. 드라이버에 대한 SMS_Driver Server WMI 클래스 개체를 가져옵니다. 드라이버는 키 속성 CI_ID으로 식별됩니다. 키 속성을 사용하여 개체를 가져오는 방법에 대한 자세한 내용은 관리 코드를 사용하여 Configuration Manager 개체를 읽는 방법을 참조하세요.

  3. 드라이버 XML을 업데이트합니다.

  4. 변경 내용을 SMS 공급자에 다시 커밋합니다.

예시

다음 예제 메서드는 로 식별 objDriver되는 드라이버에 지원되는 플랫폼을 추가합니다. 예를 들어 다음 호출 코드는 Windows XP Professional x64 운영 체제를 지원되는 플랫폼의 드라이버 objDriver 목록에 추가합니다. 개체 인스턴스에서 SMS_SupportedPlatforms 특정 플랫폼에 대한 세부 정보를 가져올 수 있습니다.

AddSupportedPlatform objDriver, "All x64 Windows XP Professional", "5.20.9999.9999","5.20.3790.0", "Win NT","x64", "SELECT * FROM Win32_OperatingSystem WHERE BuildNumber = 3790 AND OSType=18 AND ProductType=1", "SELECT * FROM Win32_Processor WHERE Architecture=9 AND DataWidth=64"

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

Sub AddSupportedPlatform( objDriver, sDisplayName, sMaxVersion, sMinVersion, sName, sPlatform, sQuery1, sQuery2 )  

    Dim xmlDoc  
    Dim objPlatformNode  
    Dim objAttr  
    Dim objQuery1Node  
    Dim objQuery2Node  
    Dim objPlatformsNode  
    Dim objDriverNode  

    ' Load the SDM Package XML.  
    Set xmlDoc = CreateObject("Msxml2.DOMDocument.6.0")  

    xmlDoc.async = False  
    xmlDoc.loadXML(objDriver.Properties_.item("SDMPackageXML"))  
    xmlDoc.setProperty _  
     "SelectionNamespaces","xmlns:dcm='http://schemas.microsoft.com/SystemsCenterConfigurationManager/2006/03/24/DesiredConfiguration'"  

    ' Create a new platform node.  
    Set objPlatformNode = xmlDoc.createNode _  
    ( 1, "PlatformApplicabilityCondition", _  
     "http://schemas.microsoft.com/SystemsCenterConfigurationManager/2006/03/24/DesiredConfiguration")  

    ' Set DisplayName.  
    Set objAttr = xmlDoc.createAttribute("DisplayName")  
    objAttr.value = sDisplayName  
    objPlatformNode.setAttributeNode(objAttr)  

    ' Set MaxVersion.  
    Set objAttr = xmlDoc.createAttribute("MaxVersion")  
    objAttr.value = sMaxVersion  
    objPlatformNode.setAttributeNode(objAttr)  

    ' Set MinVersion.  
    Set objAttr = xmlDoc.createAttribute("MinVersion")  
    objAttr.value = sMinVersion  
    objPlatformNode.setAttributeNode(objAttr)  

    ' Set Name.  
    Set objAttr = xmlDoc.createAttribute("Name")  
    objAttr.value = sName  
    objPlatformNode.setAttributeNode(objAttr)  

    ' Set Platform.  
    Set objAttr = xmlDoc.createAttribute("Platform")  
    objAttr.value = sPlatform  
    objPlatformNode.setAttributeNode(objAttr)  

    ' Set Query1.  
    Set objQuery1Node = xmlDoc.createNode(1, "Query1", "http://schemas.microsoft.com/SystemsCenterConfigurationManager/2006/03/24/DesiredConfiguration")  
    objQuery1Node.text = sQuery1  
    objPlatformNode.appendChild(objQuery1Node)  

    ' Set Query2.  
    Set objQuery2Node = xmlDoc.createNode(1, "Query2", "http://schemas.microsoft.com/SystemsCenterConfigurationManager/2006/03/24/DesiredConfiguration")  
    objQuery2Node.text = sQuery2  
    objPlatformNode.appendChild(objQuery2Node)  

    ' Append to platforms node.  
    Set objPlatformsNode = xmlDoc.selectSingleNode("/dcm:DesiredConfigurationDigest/dcm:Driver/dcm:PlatformApplicabilityConditions")      
    objPlatformsNode.appendChild(objPlatformNode)  

    ' Increment the version number.  
    Set objDriverNode = xmlDoc.selectSingleNode("/dcm:DesiredConfigurationDigest/dcm:Driver")  
    Set objAttr = objDriverNode.attributes.getNamedItem("Version")  
    objAttr.value = objAttr.value + 1  

    ' Save the object.  
    objDriver.Properties_.item("SDMPackageXML") = xmlDoc.xml  
    objDriver.Put_  

End Sub  
public void AddSupportedPlatform(  
    IResultObject driver,  
    string displayName,  
    string maxVersion,  
    string minVersion,  
    string name,  
    string platform,  
    string query1,  
    string query2)  
{  
    try  
    {  
        XmlDocument xmlDoc = new XmlDocument();  
        xmlDoc.LoadXml(driver["SDMPackageXML"].StringValue);  

        string dcmXmlNamespace = "http://schemas.microsoft.com/SystemsCenterConfigurationManager/2006/03/24/DesiredConfiguration";  
        XmlNode condition = xmlDoc.CreateNode  
         (XmlNodeType.Element, "PlatformApplicabilityCondition", dcmXmlNamespace);  

        XmlAttribute displayNameAttribute = xmlDoc.CreateAttribute("DisplayName");  
        displayNameAttribute.Value = displayName;  
        condition.Attributes.SetNamedItem(displayNameAttribute);  

        XmlAttribute osMaxVersionAttribute = xmlDoc.CreateAttribute("MaxVersion");  
        osMaxVersionAttribute.Value = maxVersion;  
        condition.Attributes.SetNamedItem(osMaxVersionAttribute);  

        XmlAttribute osMinVersionAttribute = xmlDoc.CreateAttribute("MinVersion");  
        osMinVersionAttribute.Value = minVersion;  
        condition.Attributes.SetNamedItem(osMinVersionAttribute);  

        XmlAttribute osNameAttribute = xmlDoc.CreateAttribute("Name");  
        osNameAttribute.Value = name;  
        condition.Attributes.SetNamedItem(osNameAttribute);  

        XmlAttribute osPlatformAttribute = xmlDoc.CreateAttribute("Platform");  
        osPlatformAttribute.Value = platform;  
        condition.Attributes.SetNamedItem(osPlatformAttribute);  

        // Create <Query1/> and <Query2/> child nodes.  
        // Then attach to <PlatformApplicabilityCondition/>.  
        XmlNode query1Node = xmlDoc.CreateNode  
            (XmlNodeType.Element, "Query1", dcmXmlNamespace);  
        query1Node.InnerText = query1;  
        condition.AppendChild(query1Node);  

        XmlNode query2Node = xmlDoc.CreateNode  
            (XmlNodeType.Element, "Query2", dcmXmlNamespace);  
        query2Node.InnerText = query2;  
        condition.AppendChild(query2Node);  

        XmlNode platformsNode = xmlDoc["DesiredConfigurationDigest"]["Driver"]["PlatformApplicabilityConditions"];  

         if (platformsNode == null)  
        {  
            Console.WriteLine("empty");  
        }  

        platformsNode.AppendChild(condition);  

        XmlNode driverNode = xmlDoc["DesiredConfigurationDigest"]["Driver"];  
        if (driverNode != null)  
        {  
            int driverVersion = int.Parse(driverNode.Attributes.GetNamedItem("Version").Value) + 1;  
            driverNode.Attributes.GetNamedItem("Version").Value = (driverVersion + 1).ToString();  
        }  
        else  
        {  
            throw new XmlException("Unable to find <Driver/> node while AddingSupportedPlatforms");  
        }  

        // Add the package XML to the driver.  
        StringBuilder xmlText = new StringBuilder();  
        xmlDoc.WriteContentTo(new XmlTextWriter(new StringWriter(xmlText)));  
        driver["SDMPackageXML"].StringValue = xmlText.ToString();  

       driver.Put();  
    }  
    catch (SmsException e)  
    {  
        Console.WriteLine("failed to add supported platform to driver " + e.Message);  
        throw;  
    }  
}  

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

매개 변수 형식 설명
driver

objDriver
-관리: IResultObject
- VBScript: SWbemObject
- 유효한 SMS_Driver 개체입니다. 자세한 내용은 INF 파일에서 설명한 Windows 드라이버를 Configuration Manager 가져오는 방법을 참조하세요.
displayName

sDisplayName
-관리: String
-Vbscript: String
Configuration Manager 콘솔에 표시된 조건의 표시 이름입니다.
maxVersion

sMaxVersion
-관리: String
-Vbscript: String
지원되는 최대 버전입니다.
minVersion

sMinVersion
-관리: String
-Vbscript: String
지원되는 최소 버전입니다.
name

sName
-관리: String
-Vbscript: String
운영 체제 이름입니다.
platform

sPlatform
-관리: String
-Vbscript: String
플랫폼 이름입니다.
query1

sQuery1
-관리: String
-Vbscript: String
클라이언트 플랫폼을 식별하는 데 사용되는 첫 번째 쿼리입니다.
query2

sQuery2
-관리: String
-Vbscript: String
클라이언트 플랫폼을 식별하는 데 사용되는 두 번째 쿼리입니다.

코드 컴파일

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

네임 스페이스

시스템

System.Collections.Generic

System.Text

Microsoft. ConfigurationManagement.ManagementProvider

Microsoft. ConfigurationManagement.ManagementProvider.WqlQueryEngine

System.Xml

System.io

어셈블리

microsoft.configurationmanagement.managementprovider

adminui.wqlqueryengine

강력한 프로그래밍

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

.NET Framework 보안

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

참고 항목

SMS_SupportedPlatforms 서버 WMI 클래스
개체 개요관리 코드를 사용하여 Configuration Manager SMS 공급자에 연결하는 방법
WMI를 사용하여 Configuration Manager SMS 공급자에 연결하는 방법
단계를 다른 운영 체제 배포 작업 순서 그룹으로 이동하는 방법
운영 체제 배포 작업 순서 그룹을 만드는 방법
운영 체제 배포 그룹에서 단계를 제거하는 방법
작업 순서 개요SMS_SupportedPlatforms 서버 WMI 클래스