Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Feature Forums
  3. - Uncategorised posts -
  4. WMI query to a Biztalk Server

WMI query to a Biztalk Server

Scheduled Pinned Locked Moved - Uncategorised posts -
helpdatabasecomsysadminquestion
1 Posts 1 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Francisco Rojas
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups