Counterfitninja Posted June 18, 2008 Share Posted June 18, 2008 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 More sharing options...
cartman380 Posted June 18, 2008 Share Posted June 18, 2008 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 More sharing options...
Counterfitninja Posted June 20, 2008 Author Share Posted June 20, 2008 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now