Click here to Skip to main content
15,890,123 members
Home / Discussions / - Uncategorised posts -
   

- Uncategorised posts -

Please don't post in this forum. If you've posted in this forum it's because you've selected the first forum on the list without thinking through which forum would be best. All messages in this forum are periodically removed.

 
AnswerRe: Pass by reference, Pass by value Pin
Nitin Singh India17-Sep-13 7:59
Nitin Singh India17-Sep-13 7:59 
AnswerRe: Pass by reference, Pass by value Pin
Richard MacCutchan17-Sep-13 21:44
mveRichard MacCutchan17-Sep-13 21:44 
AnswerRe: Pass by reference, Pass by value Pin
Paul Guralivu18-Sep-13 20:48
Paul Guralivu18-Sep-13 20:48 
GeneralRe: Pass by reference, Pass by value Pin
yBrian19-Sep-13 5:09
yBrian19-Sep-13 5:09 
QuestionShould I use Boonex Dolphin? Pin
NoraTomas13-Sep-13 4:49
NoraTomas13-Sep-13 4:49 
AnswerRe: Should I use Boonex Dolphin? Pin
Dave Kreskowiak13-Sep-13 9:52
mveDave Kreskowiak13-Sep-13 9:52 
AnswerRe: Should I use Boonex Dolphin? Pin
Paul Guralivu18-Sep-13 20:52
Paul Guralivu18-Sep-13 20:52 
QuestionWMI query to a Biztalk Server Pin
Francisco Rojas6-Sep-13 11:00
Francisco Rojas6-Sep-13 11:00 
Hi guys!..

This is my first post so i hope you can help me Smile | :) .

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.

SQL
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 machine unreachable".EOL;
	print "$res2Site" if TEST_CODE;
	wmi_set_result($res2Site) unless TEST_CODE;
	exit 0;
}

my $ret = exec_query($sqlQuery); 

print $res2Site if TEST_CODE;
wmi_set_result($res2Site) unless TEST_CODE;

################################# SubRoutines ##################################

sub exec_query {
    my $query = $_[0];
    my $colItems;
    $res2Site = "";
    if (not ($colItems = $objWMIService-> ExecQuery($query,"WQL",wbemFlagReturnImmediately | wbemFlagForwardOnly)) ) 
    {
    	print "WMI ExecQuery ERROR:", Win32::OLE->LastError;
    }
    
    $res2Site .= "WMI query result:\n";
    $res2Site .= "==================================================\n";
    
    my $entryCounter = 0;
    
    foreach my $key (in $colItems) 
    {
      $entryCounter++;
      $res2Site .= "\[WMIClassInstance_$entryCounter\]\n";
    	foreach (@variables)
    	{
    	     my $val = ($key->{$_})/10;
          $res2Site .= "$_=$val\n";
      }
    }
    
    $res2Site .= "==================================================\n";
    $res2Site .= "Number of Instances: $entryCounter";
    
}

Questionload balancing , content switching , url redirect using WCF application with iis or Hyper V Pin
Member 1023810728-Aug-13 5:24
Member 1023810728-Aug-13 5:24 
QuestionA programming language to make a universal program Pin
C.CoderCreator13-Aug-13 1:48
C.CoderCreator13-Aug-13 1:48 
AnswerRe: A programming language to make a universal program Pin
Richard Deeming13-Aug-13 3:06
mveRichard Deeming13-Aug-13 3:06 
AnswerRe: A programming language to make a universal program Pin
Paul Guralivu18-Sep-13 20:56
Paul Guralivu18-Sep-13 20:56 
AnswerRe: A programming language to make a universal program Pin
Paulo Augusto Kunzel26-Sep-13 3:38
professionalPaulo Augusto Kunzel26-Sep-13 3:38 
QuestionClojure Lein - Changing Root Project Folder? Pin
Dominick Marciano6-Aug-13 7:36
professionalDominick Marciano6-Aug-13 7:36 
AnswerRe: Clojure Lein - Changing Root Project Folder? Pin
Richard MacCutchan6-Aug-13 20:44
mveRichard MacCutchan6-Aug-13 20:44 
QuestionPowershell: Dynamic Email Message Body Pin
namerg20-Jun-13 10:03
namerg20-Jun-13 10:03 
QuestionDumb Arse Calling -- How do I ... Pin
Member 1011528818-Jun-13 12:16
Member 1011528818-Jun-13 12:16 
AnswerRe: Dumb Arse Calling -- How do I ... Pin
Richard MacCutchan18-Jun-13 20:47
mveRichard MacCutchan18-Jun-13 20:47 
AnswerRe: Dumb Arse Calling -- How do I ... Pin
Member 101832981-Aug-13 3:49
Member 101832981-Aug-13 3:49 
QuestionWPF Installer Creation Pin
sagar_Patel10-Jun-13 1:11
sagar_Patel10-Jun-13 1:11 
QuestionMATLAB Reversi Coding Pin
William Napier3-Jun-13 20:52
William Napier3-Jun-13 20:52 
Questioncan not download Pin
GPGPU2-Jun-13 12:57
GPGPU2-Jun-13 12:57 
AnswerRe: can not download Pin
NotPolitcallyCorrect2-Jun-13 13:55
NotPolitcallyCorrect2-Jun-13 13:55 
AnswerRe: can not download Pin
Amir Mohammad Nasrollahi29-Jul-13 22:30
professionalAmir Mohammad Nasrollahi29-Jul-13 22:30 
GeneralA philosopher's question Pin
citizenkant14-May-13 2:08
citizenkant14-May-13 2:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.