Hi All
I am a bit puzzled by a small issue Im having.
I am developing some tools to manage my virtual server 2005 environment.
Now Microsoft has COM API available to interface with Virtual Server 2005 
I am however unable to use this COM interface from perl using Win32::OLE
Here is a sample perl script.  i converted a working vbscript into the 
following perl script

=========perl script============
use Win32;
use Win32::OLE;
use constant vbCrLf => "\r\n";

my ($objVS, $strTmp, $objHI);

$objVS = Win32::OLE->new('VirtualServer.Application');

if ((0 + Win32::OLE::LastError()) != 0) {
    Win32::MsgBox('ERROR: Unable to detect Virtual server Install(obj)' . 
vbCrLf . 'Exiting Utility', 16, 'Error');
    quit();
}

$objHI = $objVS->HostInfo;
$strTmp = 'Name: ' . $objVS->Name . vbCrLf;
$strTmp = $strTmp . 'Processor Type: ' . $objHI->ProcessorManufacturerString . 
vbCrLf;
$strTmp = $strTmp . 'Host operating system: ' . $objHI->OperatingSystem . 
vbCrLf;
$strTmp = $strTmp . 'Available Memory: ' . $objHI->MemoryAvailString . vbCrLf;
Win32::MsgBox($strTmp, 0, 'RESULT');
========END PERL SCRIPT=========
The script does create the 'VirtualServer.Application' object however any 
method calls after
that fails. 
Has anyone done anything with perl and the Virtual Server COM API
Any help you can provid will be appreciated.

 
       
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to