WMI query to a Biztalk Server
-
Hi guys!.. This is my first post so i hope you can help me :). I have this WMI query that the idea is that will call the namespace MicrosoftBizTlakServer from 2 biztalk servers in order to see if they are running a Receive Location.
I've tried to fix this but i can't see the problem.
All i get is that the Class is not valid.
Any ideas of what i'm i doing wrong?.
Thanks so much!!
Regards.
Francisco.Here is the query:
# Receive Location Test
use strict;
use Win32::OLE qw(in with);use constant EOL => "\r\n";
use constant false => 0;
use constant true => 1;
use constant TEST_CODE =>0;use constant wbemFlagReturnImmediately => 0x10;
use constant wbemFlagForwardOnly => 0x20;###############################################################################
Collect all the system parameters
###############################################################################
!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!
Set / replace the following specfic variables for your specific WMI collection
my $root = "root\\MicrosoftBizTalkServer";
my @variables = ("Name", "ReceivePortName","IsDisabled");
my $sqlQuery = "select ".join(",",@variables)." from MSBTS_ReceiveLocation";
my ($strUser, $strPasswd, $strDomain);
my $res2Site;
my $device_ip = "127.0.0.1";if (!TEST_CODE) {
my ($model_name,$version_name,$vendor_name,$pl_name,$device_sn,$device_name);
get_device_info($device_ip,$model_name,$version_name,$vendor_name,$pl_name,$device_sn,$device_name);
}if (TEST_CODE) {
$strUser = "administrator";
$strPasswd = "painter";
$strDomain = "";
} else {
my %protocol_settings = get_protocol_settings('WMI');
$strUser = $protocol_settings{"Username"};
$strPasswd = $protocol_settings{"Password"};
$strDomain = $protocol_settings{"Domain"};
}my $objWMILocator = Win32::OLE->CreateObject("WbemScripting.SWbemLocator");
my $objWMIService = "";if ($device_ip eq "127.0.0.1") {
$objWMIService = Win32::OLE-> GetObject("winmgmts:\\\\$device_ip\\$root");
} else {
$objWMIService = $objWMILocator->ConnectServer($device_ip, $root, $strDomain."\\".$strUser, $strPasswd);
}if (not $objWMIService) { # for the local machine you may use ($objWMIService = Win32::OLE-> GetObject("winmgmts:\\\\$device_ip\\root\\MicrosoftBizTalkServer"))
print "WMI Moniker ERROR:".Win32::OLE->LastError.EOL;
$res2Site .= "ERROR: Remote