none
Calling Msvm_ComputerSystem with ASP RRS feed

  • Question

  • Set objWMIService = GetObject( "winmgmts:\\.\root\Virtualization")
    Set VMList = objWMIService.ExecQuery("SELECT * FROM Msvm_ComputerSystem")

    Response.Write VMList.ItemIndex(0).ElementName
    For Each VM In VMList
            Response.Write VM.ElementName
    Next

    The above code only returns me the parent host's name but not the VMs.
    However, I can get all names with vbs.
    Do you have any idea about this? Thanks.
    Friday, November 7, 2008 6:40 AM

All replies

  • Hi there, I'm having the same issue, did you found what was happening?

    Thanks,
    Nabani

    Monday, February 9, 2009 4:56 PM
  • I am still unable to solve it.
    I guess is something related to the rights
    Wednesday, March 11, 2009 6:45 AM
  • It works for me if I start powershell with admin rights.

    Regards,
    Nabani

    Saturday, March 21, 2009 4:11 AM
  • It works for me if I start powershell with admin rights.

    Regards,
    Nabani


    Do you mean calling powershell with ASP? Can you give me the sample code? Thanks.
    Monday, March 30, 2009 2:18 AM