proprietà MSBTS_ReceivePort.Name (WMI)
Contiene il nome della porta di ricezione.
La sintassi illustrata è indipendente dal linguaggio.
Sintassi
string Name;
Osservazioni
Questa proprietà è obbligatoria per la creazione di istanze. Questa proprietà è scrivibile solo al momento della creazione di istanze. Dopo la creazione di istanze, questa proprietà sarà di sola lettura.
Questa proprietà ha un qualificatore Key . Insieme a MgmtDbNameOverride e MgmtDbServerOverride, questa chiave forma una chiave composta per la classe.
La lunghezza massima per questa proprietà è di 256 caratteri.
Questa proprietà esegue il wrapping della proprietà Microsoft.BizTalk.ExplorerOM.ReceivePort.Name gestita.
Esempio
L'esempio seguente è tratto dal file SDK\Samples\Admin\WMI\Remove Receive Port\VBScript\RemoveReceivePort.vbs.
Sub RemoveReceivePort()
'Get the command line arguments entered for the script
Dim objArgs: Set objArgs = WScript.Arguments
'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
'Make sure the expected number of arguments were provided on the command line.
'if not, print usage text and exit.
If (objArgs.Count <> 1) Then
PrintUsage()
WScript.Quit 0
End If
Dim objInstSet, objInst, strQuery
Dim strReceivePortName
strReceivePortName = objArgs(0)
'set up a WMI query to acquire a list of receive locations with the given Name and
'ReceivePortName key values. This should be a list of zero or one Receive Locations.
strQuery = "SELECT * FROM MSBTS_ReceivePort WHERE Name =""" & strReceivePortName & """"
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 Receive Location found, enable it, otherwise print error and end.
If objInstSet.Count > 0 then
For Each objInst in objInstSet
'Now remove the receive port
objInst.Delete_()
If Err <> 0 Then
PrintWMIErrorThenExit Err.Description, Err.Number
End If
WScript.Echo "The Receive Port was successfully removed."
Next
Else
WScript.Echo "No Receive Port was found matching that Name."
End If
End Sub
Nessun esempio fornito per C#.
Requisiti
Intestazione: dichiarata in BTSWMISchema2K.mof o BTSWMISchemaXP.mof.
Spazio dei nomi: incluso in \root\MicrosoftBizTalkServer.