MSBTS_ReceivePort.Name, propriété (WMI)
Contient le nom du port de réception.
La syntaxe présentée est indépendante de la langue.
Syntaxe
string Name;
Notes
Cette propriété est requise pour la création d'une instance. Elle n'est accessible en écriture qu'au moment de la création d'une instance. Par la suite, elle est toujours en lecture seule.
Cette propriété a un qualificateur de clé . Avec MgmtDbNameOverride et MgmtDbServerOverride, cette clé forme une clé composée pour la classe.
La longueur maximale de cette propriété est de 256 caractères.
Cette propriété encapsule la propriété Microsoft.BizTalk.ExplorerOM.ReceivePort.Name managée.
Exemple
L'exemple suivant est issu du fichier 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
Aucun exemple n'est fourni pour C#.
Spécifications
En-tête : déclaré dans BTSWMISchema2K.mof ou BTSWMISchemaXP.mof.
Espace de noms : inclus dans \root\MicrosoftBizTalkServer.