Scripting automatic startup for virtual machines under Microsoft Virtual Server

Discussion in 'PHP' started by techscorpio, Aug 28, 2006.

  1. #1
    Hi,

    I am trying to develope a PHP script which will automatic startup for virtual machines under Microsoft Virtual Server 2005 r2 but it failed due to COM object saying Source unknown But the same thing when i tried through VB script it works fine.
    VB script:

    Set objVS = CreateObject("VirtualServer.Application")
    Set objVM = objVS.FindVirtualMachine("VM Name")
    objVM.RunAsDefinedAccount = True
    result = objVM.SetAccountNameAndPassword("DOMAIN\Username","Password")
    objVM.AutoStartAtLaunch = 2

    It Worked fine
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ___________ _ _ _ _ _
    PHP Script:

    $objVS = new COM("VirtualServer.Application");
    $objVM = $objVS->FindVirtualMachine("Scorpio");
    $objVM->Startup();
    it throuhgs Error at FindVirtualMachine function saying

    ERROR: Fatal error: Uncaught exception 'com_exception' with message 'Source: Unknown


    Plese Help me it's urgengt !!

    Thanks in advance
     
    techscorpio, Aug 28, 2006 IP
  2. luizeba

    luizeba Active Member

    Messages:
    265
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    Lol, sorry, I think I can't help in it...
    I'm really noob at PHP >.<
     
    luizeba, May 24, 2009 IP