in reply to WMI query Exchange Server with Perl

What is the problem with what you posted? Why not use DBD::WMI?

  • Comment on Re: WMI query Exchange Server with Perl

Replies are listed 'Best First'.
Re^2: WMI query Exchange Server with Perl
by arnaud99 (Beadle) on Dec 17, 2012 at 17:21 UTC

    Hi There, A tool I have used a lot in the past is Scriptomatic (from the Microsoft Scripting Guys). It generates basic scripts with WMI queries once you have chosen your WMI Class. I am not sure if your class is in there but it may be worth a try. Scripts are generated in various scripting languages including Perl. As far as I know Scriptomatic only runs on a Win platform.

Re^2: WMI query Exchange Server with Perl
by Ice-Breaker (Novice) on Dec 17, 2012 at 15:23 UTC
    The problem is with the exchange wmi classes, when I run default wmi queries like Select * from Win32_ComputerSystem they run fine, but with the exchange classes its a bit of a problem and the code fails at die "problem".Win32::OLE->LastError;
    problemWin32::OLE(0.1703) error 0x80041021 after character 0 in "winmgmts:{impersonationLevel=impersonate}!\\.\ROOT mv2pplications +←xchange:E xchangeQueue" at test_wmi.pl line 11.
    Is there any way of accessing exchange performance classes with perl in any way? I've done some reading about it and the documentation is around but there are no samples and not quite what I'm looking for..

      First, do it using the wmic command. Once you have worked out how to do it there, doing the same using OLE will either be trivial, or indicate a problem with Win32::OLE


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong