Propiedad MSBTS_ReceiveLocation.Name (WMI)
Contiene el nombre de la ubicación de recepción.
La sintaxis se muestra en lenguaje neutro.
Sintaxis
string Name;
Comentarios
Esta propiedad se puede escribir en la creación de instancias. Después de la creación de instancias, esta propiedad es de solo lectura.
Esta propiedad tiene un calificador Key . Junto con MgmtDbNameOverride, ReceivePortName y MgmtDbServerOverride, esta clave forma una clave compuesta para la clase .
La longitud máxima de esta propiedad es de 128 caracteres.
Esta propiedad ajusta la propiedad de Microsoft.BizTalk.ExplorerOM.ReceiveLocation.Name administrada.
Ejemplo
El siguiente ejemplo se tomó del archivo SDK\Samples\Admin\WMI\Enumerate Receive Locations\VBScript\EnumRecLocs.vbs.
Sub EnumRecLocs()
'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
Dim InstSet, Inst
set InstSet = GetObject ("winmgmts:\root\MicrosoftBizTalkServer").InstancesOf("MSBTS_ReceiveLocation")
'Check for error condition before continuing.
If Err <> 0 Then
PrintWMIErrorThenExit Err.Description, Err.Number
End If
'Report on number of receive locations found and list each one.
wscript.echo "A Total of " & InstSet.Count & " Receive Locations were found."
If InstSet.Count > 0 Then
For Each Inst In InstSet
wscript.echo
wscript.echo "Receive Location Name: " & Inst.Name
wscript.echo " Disabled : " & Inst.IsDisabled
wscript.echo " Pipeline Name : " & Inst.PipelineName
wscript.echo " Receive Port Name : " & Inst.ReceivePortName
wscript.echo
next
End If
End Sub
El siguiente ejemplo se tomó del archivo SDK\Samples\Admin\WMI\Enumerate Receive Locations\CSharp\EnumRLs.cs.
static void Main(string[] args)
{
// Display help information
if (args.Length > 0)
{
if (args[0] == "/?")
{
Console.WriteLine();
Console.WriteLine();
Console.WriteLine("The correct usage of this sample is \"EnumRL.exe [RLName]\"");
Console.WriteLine("Where [RLname] is the name of a particular receive location to enumerate.");
Console.WriteLine("If receive location name contains spaces make sure to put it in quotes");
Console.WriteLine();
Console.WriteLine("Example #1 Enumerate all the receive locations.");
Console.WriteLine(" EnumRL");
Console.WriteLine();
Console.WriteLine("Example#2 enumerate just the \"My Receive Location #3\" receive location.");
Console.WriteLine(" EnumRL \"My Receive Location #3\" ");
Console.WriteLine();
Console.WriteLine();
Console.WriteLine("To get help use enumRL.exe /?");
return;
}
}
try
{
//Create the WMI search object.
ManagementObjectSearcher Searcher = new ManagementObjectSearcher();
// create the scope node so we can set the WMI root node correctly.
ManagementScope Scope = new ManagementScope("root\\MicrosoftBizTalkServer");
Searcher.Scope = Scope;
// Build a Query to enumerate the MSBTS_ReceiveLocation instances if an argument
// is supplied use it to select only the matching RL.
SelectQuery Query = new SelectQuery();
if (args.Length == 0)
Query.QueryString="SELECT * FROM MSBTS_ReceiveLocation";
else
Query.QueryString="SELECT * FROM MSBTS_ReceiveLocation WHERE Name = '" + args[0] + "'";
// Set the query for the searcher.
Searcher.Query = Query;
// Execute the query and determine if any results were obtained.
ManagementObjectCollection QueryCol = Searcher.Get();
// Use a bool to tell if we enter the for loop
// below because Count property is not supported
bool ReceiveLocationFound = false;
// Enumerate all properties.
foreach (ManagementBaseObject envVar in QueryCol)
{
// There is at least one Receive Location
ReceiveLocationFound = true;
Console.WriteLine("**************************************************");
Console.WriteLine("Receive Location: {0}", envVar["Name"]);
Console.WriteLine("**************************************************");
PropertyDataCollection envVarProperties = envVar.Properties;
Console.WriteLine("Output in the form of: Property: {Value}");
foreach (PropertyData envVarProperty in envVarProperties)
{
Console.WriteLine(envVarProperty.Name+ ":\t" + envVarProperty.Value);
}
}
if (!ReceiveLocationFound)
{
Console.WriteLine("No receive locations found matching the specified name.");
}
}
catch(Exception excep)
{
Console.WriteLine(excep.ToString());
}
Console.WriteLine("\r\n\r\nPress Enter to continue...");
Console.Read();
}
Requisitos
Rúbrica: Declarado en BTSWMISchemaXP.mof.
Espacio de nombres: incluido en \root\MicrosoftBizTalkServer.