Recent Virtual Server 2005 posts* * * * * * * * * * * * * * * * * * * *
|
Add Solution
Latest Topics
Post Reply |
This is Spam! | Mark as Spam
Scripting with Virtual ServerSource: microsoft.public.virtualserver Sent: 12/13/2006 From: "Drew Burchett" <(email address - cut out)> Message:I am attempting to access the VirtualServer.Application object through the
Perl Win32::OLE interface. I attempt to create an object by invoking the
new method as:
$virtualServer = Win32::OLE->new("VirtualServer.Application");
No error is returned, and if I use Data::Dumper to print the $virtualServer
object, it shows all the properties and methods, but each one if them is
listed as undef. If I attempt to use any of the properties or methods, they
fail. Can anyone make any suggestions on how to get this working?
Post Reply |
This is Spam! | Mark as Spam
Related Messages
Sent: 12/13/2006 From: Richard Cardona <(email address - cut out)> Message:Sorry I don't have a specific suggestion. I just wrote this and here's
the output...
ActiveState perl 5.6.1
Source:
----------- START ---------
use Win32::OLE;
use Data::Dumper;
my $virtualServer = Win32::OLE->new("VirtualServer.Application");
print "Version of MSVS: " . $virtualServer->Version . "\n";
print Dumper($virtualServer), "\n";
----------- END -------------
Version of MSVS: 1.1.292.0 EE R2
$VAR1 = bless( {
'HostInfo' => bless( {
'LogicalProcessorCount' => 1,
'PhysicalProcessorCount' => 1,
'ProcessorSpeed' => 2993,
'ProcessorSpeedString' => '3.0
GHz',
'ProcessorManufacturerString'
=> 'Intel Pentium 4 class',
'ProcessorVersionString' =>
'x86 F15 M4 S3',
'ProcessorFeaturesString' =>
'MMX, SSE3, x86-64',
'MMX' => 1,
'SSE' => 1,
'SSE2' => 0,
'ThreeDNow' => 0,
'Memory' => '2047',
'MemoryTotalString' => '2047 MB',
'MemoryAvail' => '663',
'MemoryAvailString' => '663 MB',
'OperatingSystem' => 'Windows®
XP Professional',
'OSVersionString' => '5.1.2600',
'OSMajorVersion' => 5,
'OSMinorVersion' => 1,
'OSServicePackString' =>
'Service Pack 2',
'NetworkAdapters' => [
'Intel(R) PRO/1000 MTW Network Connection'
],
'NetworkAddresses' => [
'10.1.41.35'
],
'HostDrives' => [
'\\\\.\\PHYSICALDRIVE0'
],
'DVDDrives' => [
68,
69
],
'FloppyDrives' => [
65
],
'SerialPorts' => 'COM1;COM2;',
'parallelPort' => 'LPT1
(378h-37Fh)',
'UTCTime' => bless( do{\(my $o
= 28660456)}, 'Win32::OLE::Variant' )
}, 'Win32::OLE' ),
'DefaultLocale' => '1033',
'VirtualMachines' => bless( {
'Count' => 8,
'Item' => undef
}, 'Win32::OLE' ),
'VirtualNetworks' => bless( {
'Count' => 2,
'Item' => undef
}, 'Win32::OLE' ),
'UnconnectedNetworkAdapters' => bless( {
'Count' => 0,
'Item' => undef
}, 'Win32::OLE' ),
'SupportDrivers' => bless( {
'Count' => 2,
'Item' => undef
}, 'Win32::OLE' ),
'Tasks' => bless( {
'Count' => 0,
'Item' => undef
}, 'Win32::OLE' ),
'VSScriptsEnabled' => 0,
'VMScriptsEnabled' => 0,
'VMRCEnabled' => 1,
'VMRCAdminAddress' => '',
'VMRCAdminPortNumber' => 5900,
'VMRCXResolution' => 800,
'VMRCYResolution' => 600,
'VMRCEncryptionEnabled' => 0,
'VMRCAuthenticator' => bless( {
'Type' => 4,
'Name' => 'Automatic',
'Description' =>
'Automatically choose between NTLM and Kerberos authentication.'
}, 'Win32::OLE' ),
'VMRCAuthenticators' => bless( {
'Count' => 3,
'Item' => undef
}, 'Win32::OLE' ),
'VMRCIdleConnectionTimeoutEnabled' => 0,
'VMRCIdleConnectionTimeout' => 900,
'VMRCEncryptionCertificate' => '',
'VMRCEncryptionCertificateRequest' => '',
'MinimumMemoryPerVM' => 4,
'MaximumMemoryPerVM' => 1846,
'SuggestedMaximumMemoryPerVM' => 1661,
'MaximumFloppyDrivesPerVM' => 1,
'MaximumSerialPortsPerVM' => 2,
'MaximumParallelPortsPerVM' => 1,
'MaximumNetworkAdaptersPerVM' => 4,
'MaximumNumberOfIDEBuses' => 2,
'MaximumNumberOfSCSIControllers' => 4,
'DefaultVMConfigurationPath' => 'C:\\Documents and
Settings\\All Users\\Documents\\Shared Virtual Machines\\',
'DefaultVNConfigurationPath' => 'C:\\Documents and
Settings\\All Users\\Documents\\Shared Virtual Networks\\',
'SearchPaths' => undef,
'Name' => 'Virtual Server',
'Version' => '1.1.292.0 EE R2',
'ProductID' => '73567-xxx-xxxxxxx-xxxxx',
'UpTime' => 102016,
'AvailableSystemCapacity' => '100',
'Security' => bless( {
'OwnerName' => 'Administrators',
'OwnerSid' => 'S-1-5-xx-xxx',
'GroupName' => 'Administrators',
'GroupSid' => 'S-1-5-xx-xxx',
'AccessRights' => bless( {
'Count' => 6,
'Item' => undef
},
'Win32::OLE' )
}, 'Win32::OLE' )
}, 'Win32::OLE' );
Sent: 12/14/2006 From: "Drew Burchett" <(email address - cut out)> Message:Well, I seem to have found a solution. Not sure if it's THE solution or
not. But if I save the file as a pls and run it through cscript instead of
perl, it works correctly.
"Richard Cardona" <(email address - cut out)> wrote in message
news:(email address - cut out)...
Show quoted text > Sorry I don't have a specific suggestion. I just wrote this and here's the
> output...
>
> ActiveState perl 5.6.1
>
> Source:
> ----------- START ---------
> use Win32::OLE;
> use Data::Dumper;
>
> my $virtualServer = Win32::OLE->new("VirtualServer.Application");
>
> print "Version of MSVS: " . $virtualServer->Version . "\n";
>
> print Dumper($virtualServer), "\n";
>
> ----------- END -------------
>
> Version of MSVS: 1.1.292.0 EE R2
> $VAR1 = bless( {
> 'HostInfo' => bless( {
> 'LogicalProcessorCount' => 1,
> 'PhysicalProcessorCount' => 1,
> 'ProcessorSpeed' => 2993,
> 'ProcessorSpeedString' => '3.0
> GHz',
> 'ProcessorManufacturerString' =>
> 'Intel Pentium 4 class',
> 'ProcessorVersionString' => 'x86
> F15 M4 S3',
> 'ProcessorFeaturesString' => 'MMX,
> SSE3, x86-64',
> 'MMX' => 1,
> 'SSE' => 1,
> 'SSE2' => 0,
> 'ThreeDNow' => 0,
> 'Memory' => '2047',
> 'MemoryTotalString' => '2047 MB',
> 'MemoryAvail' => '663',
> 'MemoryAvailString' => '663 MB',
> 'OperatingSystem' => 'Windows® XP
> Professional',
> 'OSVersionString' => '5.1.2600',
> 'OSMajorVersion' => 5,
> 'OSMinorVersion' => 1,
> 'OSServicePackString' => 'Service
> Pack 2',
> 'NetworkAdapters' => [
>
> 'Intel(R) PRO/1000 MTW Network Connection'
> ],
> 'NetworkAddresses' => [
>
> '10.1.41.35'
> ],
> 'HostDrives' => [
>
> '\\\\.\\PHYSICALDRIVE0'
> ],
> 'DVDDrives' => [
> 68,
> 69
> ],
> 'FloppyDrives' => [
> 65
> ],
> 'SerialPorts' => 'COM1;COM2;',
> 'parallelPort' => 'LPT1
> (378h-37Fh)',
> 'UTCTime' => bless( do{\(my $o =
> 28660456)}, 'Win32::OLE::Variant' )
> }, 'Win32::OLE' ),
> 'DefaultLocale' => '1033',
> 'VirtualMachines' => bless( {
> 'Count' => 8,
> 'Item' => undef
> }, 'Win32::OLE' ),
> 'VirtualNetworks' => bless( {
> 'Count' => 2,
> 'Item' => undef
> }, 'Win32::OLE' ),
> 'UnconnectedNetworkAdapters' => bless( {
> 'Count' => 0,
> 'Item' => undef
> }, 'Win32::OLE' ),
> 'SupportDrivers' => bless( {
> 'Count' => 2,
> 'Item' => undef
> }, 'Win32::OLE' ),
> 'Tasks' => bless( {
> 'Count' => 0,
> 'Item' => undef
> }, 'Win32::OLE' ),
> 'VSScriptsEnabled' => 0,
> 'VMScriptsEnabled' => 0,
> 'VMRCEnabled' => 1,
> 'VMRCAdminAddress' => '',
> 'VMRCAdminPortNumber' => 5900,
> 'VMRCXResolution' => 800,
> 'VMRCYResolution' => 600,
> 'VMRCEncryptionEnabled' => 0,
> 'VMRCAuthenticator' => bless( {
> 'Type' => 4,
> 'Name' => 'Automatic',
> 'Description' =>
> 'Automatically choose between NTLM and Kerberos authentication.'
> }, 'Win32::OLE' ),
> 'VMRCAuthenticators' => bless( {
> 'Count' => 3,
> 'Item' => undef
> }, 'Win32::OLE' ),
> 'VMRCIdleConnectionTimeoutEnabled' => 0,
> 'VMRCIdleConnectionTimeout' => 900,
> 'VMRCEncryptionCertificate' => '',
> 'VMRCEncryptionCertificateRequest' => '',
> 'MinimumMemoryPerVM' => 4,
> 'MaximumMemoryPerVM' => 1846,
> 'SuggestedMaximumMemoryPerVM' => 1661,
> 'MaximumFloppyDrivesPerVM' => 1,
> 'MaximumSerialPortsPerVM' => 2,
> 'MaximumParallelPortsPerVM' => 1,
> 'MaximumNetworkAdaptersPerVM' => 4,
> 'MaximumNumberOfIDEBuses' => 2,
> 'MaximumNumberOfSCSIControllers' => 4,
> 'DefaultVMConfigurationPath' => 'C:\\Documents and
> Settings\\All Users\\Documents\\Shared Virtual Machines\\',
> 'DefaultVNConfigurationPath' => 'C:\\Documents and
> Settings\\All Users\\Documents\\Shared Virtual Networks\\',
> 'SearchPaths' => undef,
> 'Name' => 'Virtual Server',
> 'Version' => '1.1.292.0 EE R2',
> 'ProductID' => '73567-xxx-xxxxxxx-xxxxx',
> 'UpTime' => 102016,
> 'AvailableSystemCapacity' => '100',
> 'Security' => bless( {
> 'OwnerName' => 'Administrators',
> 'OwnerSid' => 'S-1-5-xx-xxx',
> 'GroupName' => 'Administrators',
> 'GroupSid' => 'S-1-5-xx-xxx',
> 'AccessRights' => bless( {
>
> 'Count' => 6,
>
> 'Item' => undef
> },
> 'Win32::OLE' )
> }, 'Win32::OLE' )
> }, 'Win32::OLE' );
>
Sent: 12/14/2006 From: Richard Cardona <(email address - cut out)> Message:Mine was a .pl file run by a registered .pl extension by Activestate
with no cscript involved.
Drew Burchett wrote:
Show quoted text > Well, I seem to have found a solution. Not sure if it's THE solution or not. But if I save the file as a pls and run it through cscript instead of
> perl, it works correctly.
Sent: 01/02/2007 From: "Drew Burchett" <(email address - cut out)> Message:For anyone who may be interested, I've located the source of this problem
and the solution. It seems that perl (and HTA and a couple of other
scripting languages) use the default impersonation level of the machine when
creating COM objects. On a 2003 Server, this default impersonation level is
Identity. If you set the default impersonation level to Impersonate, the
scripts work perfectly.
Please let me know if anyone has any reason this shouldn't be done or any
more information on this.
"Drew Burchett" <(email address - cut out)> wrote in message
news:%235q$(email address - cut out)...
Show quoted text > Well, I seem to have found a solution. Not sure if it's THE solution or
> not. But if I save the file as a pls and run it through cscript instead
> of perl, it works correctly.
>
> "Richard Cardona" <(email address - cut out)> wrote in message
> news:(email address - cut out)...
>> Sorry I don't have a specific suggestion. I just wrote this and here's
>> the output...
>>
>> ActiveState perl 5.6.1
>>
>> Source:
>> ----------- START ---------
>> use Win32::OLE;
>> use Data::Dumper;
>>
>> my $virtualServer = Win32::OLE->new("VirtualServer.Application");
>>
>> print "Version of MSVS: " . $virtualServer->Version . "\n";
>>
>> print Dumper($virtualServer), "\n";
>>
>> ----------- END -------------
>>
>> Version of MSVS: 1.1.292.0 EE R2
>> $VAR1 = bless( {
>> 'HostInfo' => bless( {
>> 'LogicalProcessorCount' => 1,
>> 'PhysicalProcessorCount' => 1,
>> 'ProcessorSpeed' => 2993,
>> 'ProcessorSpeedString' => '3.0
>> GHz',
>> 'ProcessorManufacturerString' =>
>> 'Intel Pentium 4 class',
>> 'ProcessorVersionString' => 'x86
>> F15 M4 S3',
>> 'ProcessorFeaturesString' =>
>> 'MMX, SSE3, x86-64',
>> 'MMX' => 1,
>> 'SSE' => 1,
>> 'SSE2' => 0,
>> 'ThreeDNow' => 0,
>> 'Memory' => '2047',
>> 'MemoryTotalString' => '2047 MB',
>> 'MemoryAvail' => '663',
>> 'MemoryAvailString' => '663 MB',
>> 'OperatingSystem' => 'Windows® XP
>> Professional',
>> 'OSVersionString' => '5.1.2600',
>> 'OSMajorVersion' => 5,
>> 'OSMinorVersion' => 1,
>> 'OSServicePackString' => 'Service
>> Pack 2',
>> 'NetworkAdapters' => [
>>
>> 'Intel(R) PRO/1000 MTW Network Connection'
>> ],
>> 'NetworkAddresses' => [
>>
>> '10.1.41.35'
>> ],
>> 'HostDrives' => [
>>
>> '\\\\.\\PHYSICALDRIVE0'
>> ],
>> 'DVDDrives' => [
>> 68,
>> 69
>> ],
>> 'FloppyDrives' => [
>> 65
>> ],
>> 'SerialPorts' => 'COM1;COM2;',
>> 'parallelPort' => 'LPT1
>> (378h-37Fh)',
>> 'UTCTime' => bless( do{\(my $o =
>> 28660456)}, 'Win32::OLE::Variant' )
>> }, 'Win32::OLE' ),
>> 'DefaultLocale' => '1033',
>> 'VirtualMachines' => bless( {
>> 'Count' => 8,
>> 'Item' => undef
>> }, 'Win32::OLE' ),
>> 'VirtualNetworks' => bless( {
>> 'Count' => 2,
>> 'Item' => undef
>> }, 'Win32::OLE' ),
>> 'UnconnectedNetworkAdapters' => bless( {
>> 'Count' => 0,
>> 'Item' => undef
>> },
>> 'Win32::OLE' ),
>> 'SupportDrivers' => bless( {
>> 'Count' => 2,
>> 'Item' => undef
>> }, 'Win32::OLE' ),
>> 'Tasks' => bless( {
>> 'Count' => 0,
>> 'Item' => undef
>> }, 'Win32::OLE' ),
>> 'VSScriptsEnabled' => 0,
>> 'VMScriptsEnabled' => 0,
>> 'VMRCEnabled' => 1,
>> 'VMRCAdminAddress' => '',
>> 'VMRCAdminPortNumber' => 5900,
>> 'VMRCXResolution' => 800,
>> 'VMRCYResolution' => 600,
>> 'VMRCEncryptionEnabled' => 0,
>> 'VMRCAuthenticator' => bless( {
>> 'Type' => 4,
>> 'Name' => 'Automatic',
>> 'Description' =>
>> 'Automatically choose between NTLM and Kerberos authentication.'
>> }, 'Win32::OLE' ),
>> 'VMRCAuthenticators' => bless( {
>> 'Count' => 3,
>> 'Item' => undef
>> }, 'Win32::OLE' ),
>> 'VMRCIdleConnectionTimeoutEnabled' => 0,
>> 'VMRCIdleConnectionTimeout' => 900,
>> 'VMRCEncryptionCertificate' => '',
>> 'VMRCEncryptionCertificateRequest' => '',
>> 'MinimumMemoryPerVM' => 4,
>> 'MaximumMemoryPerVM' => 1846,
>> 'SuggestedMaximumMemoryPerVM' => 1661,
>> 'MaximumFloppyDrivesPerVM' => 1,
>> 'MaximumSerialPortsPerVM' => 2,
>> 'MaximumParallelPortsPerVM' => 1,
>> 'MaximumNetworkAdaptersPerVM' => 4,
>> 'MaximumNumberOfIDEBuses' => 2,
>> 'MaximumNumberOfSCSIControllers' => 4,
>> 'DefaultVMConfigurationPath' => 'C:\\Documents and
>> Settings\\All Users\\Documents\\Shared Virtual Machines\\',
>> 'DefaultVNConfigurationPath' => 'C:\\Documents and
>> Settings\\All Users\\Documents\\Shared Virtual Networks\\',
>> 'SearchPaths' => undef,
>> 'Name' => 'Virtual Server',
>> 'Version' => '1.1.292.0 EE R2',
>> 'ProductID' => '73567-xxx-xxxxxxx-xxxxx',
>> 'UpTime' => 102016,
>> 'AvailableSystemCapacity' => '100',
>> 'Security' => bless( {
>> 'OwnerName' => 'Administrators',
>> 'OwnerSid' => 'S-1-5-xx-xxx',
>> 'GroupName' => 'Administrators',
>> 'GroupSid' => 'S-1-5-xx-xxx',
>> 'AccessRights' => bless( {
>>
>> 'Count' => 6,
>>
>> 'Item' => undef
>> },
>> 'Win32::OLE' )
>> }, 'Win32::OLE' )
>> }, 'Win32::OLE' );
>>
>
>
Post Reply |
This is Spam! | Mark as Spam
Other groups
|