MSBTS_SendHandler.AdapterName 속성(WMI)

 

사용된 어댑터의 이름을 포함합니다.

표시된 구문은 언어 중립적입니다.

구문

  
string AdapterName;  

설명

인스턴스를 만들려면 이 속성이 필요합니다. 인스턴스를 만들 때 이 속성은 쓰기 가능 상태가 됩니다. 인스턴스를 만든 후에 이 속성은 읽기 전용이 됩니다.

이 속성에는 한정자 가 있습니다. MgmtDbNameOverrideMgmtDbServerOverride와 함께 이 키는 클래스에 대한 복합 키를 형성합니다.

이 속성의 최대 길이는 256자입니다.

예제

다음 예제는 SDK\Samples\Admin\WMI\Set Send Handler Property\VBScript\ConfigureSMTP.vbs 파일에서 가져온 것입니다.

  
Sub ConfigureSMTPSendHandler()  
   'error handling is done by explicity checking the err object rather than using  
   'the VB ON ERROR construct, so set to resume next on error.  
   On Error Resume Next  
  
   'Get the command line arguments entered for the script  
   Dim objArgs: Set objArgs = WScript.Arguments  
  
   'Make sure the expected number of arguments were provided on the command line.  
   'if not, print usage text and exit.  
   If (objArgs.Count <> 2) Then  
      PrintUsage()  
      WScript.Quit 0  
   End If  
  
   Dim objInstSet, objInst, strQuery, strSMTPHostName, strFromAddress, strConfigXML, strAdapterName  
  
   strAdapterName = "SMTP"  
   strSMTPHostName = objArgs(0)  
   strFromAddress = objArgs(1)  
   strConfigXML = "<CustomProps><SMTPHost vt=""8"">" & strSMTPHostName & "</SMTPHost><SMTPAuthenticate vt=""19"">2</SMTPAuthenticate><From vt=""8"">" & strFromAddress & "</From></CustomProps>"  
  
   'set up a WMI query to acquire a list of send handlers with the given Name key value.  
   'This should be a list of zero or one send handlers.  
   strQuery = "SELECT * FROM MSBTS_SendHandler WHERE AdapterName =""" & strAdapterName & """"  
   Set objInstSet = GetObject("Winmgmts:!root\MicrosoftBizTalkServer").ExecQuery(strQuery)  
  
   'Check for error condition before continuing.  
   If Err <> 0   Then  
      PrintWMIErrorThenExit Err.Description, Err.Number  
   End If  
  
   'If send handler found, set configuration information, otherwise print error and end.  
   If objInstSet.Count > 0 then  
      For Each objInst in objInstSet  
         'Set config data for send handler  
         objInst.CustomCfg = strConfigXML  
         If Err <> 0   Then  
            PrintWMIErrorThenExit Err.Description, Err.Number  
         End If  
  
         'Commit the change to the database  
         objInst.Put_(1)  
         If Err <> 0   Then  
            PrintWMIErrorThenExit Err.Description, Err.Number  
         End If  
         WScript.Echo "The Send Handler was successfully configured."  
      Next  
   Else  
      WScript.Echo "No Send Handler was found matching that AdapterName."  
   End If  
End Sub  
  

C# 샘플은 제공되지 않습니다.

요구 사항

헤더: BTSWMISchema2K.mof 또는 BTSWMISchemaXP.mof에 선언되어 있습니다.

네임스페이스: \root\MicrosoftBizTalkServer에 포함되어 있습니다.