Jump to content

Virtual server control


Recommended Posts

I have been trying to convert this simple vbscript :

Set objVS = CreateObject("VirtualServer.Application")

Set objVM = objVS.FindVirtualMachine("sales")

Set objGuestOS = objVM.GuestOS

to autoit, however it fails on the second part. i have been testing with this:

$VS = ObjCreate("VirtualServer.Application")

$ft = $VS.FindVirtualMachine("sales")

but it fails. anythoughts?

Link to comment
Share on other sites

Have you tried putting some error logic in there to see if it's actually an object being returned, in the help file it said to always have error logic because not all machines have the same objects. Which would mean checking for @error or if the object = 0.

$VS = ObjCreate("VirtualServer.Application")
If @error Then ConsoleWrite("Error creating object")
$ft = $VS.FindVirtualMachine("sales")

or

$VS = ObjCreate("VirtualServer.Application")
If ($VS = 0) Then ConsoleWrite("Error creating object")
$ft = $VS.FindVirtualMachine("sales")

Also you might try using virtualserver.application all lowercase instead of VirtualServer.Application. Or some variance likt that. Not really familliar with Virtual Servers but those are some thoughts.

Link to comment
Share on other sites

Yeah i have tried error checking and lowercase but continually get, which suggests to me it fiun

(3) : ==> The requested action with this object has failed.:

$ft = $VS.FindVirtualMachine("sales")

$ft = $VS.FindVirtualMachine("sales")^ ERROR

->13:48:38 AutoIT3.exe ended.rc:1

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...