Hyper-V Startup Script Not Working, in Virtual Server 2005
ASP Developer Network - Brought to you by Steve Radich and BitShop, Inc. - http://www.bitshop.com

Menu

ASPDeveloper.Net / VirtualServerFAQ.COM

Make sure you go to our home page for:

* Virtual Server 2005 FAQ
* ASP.Net 2.0 Information
* ASP.Net 2.0 Streaming Tutorials
* ASP.Net 2.0 HTML based Tutorials

Made possible by Business Internet Technology Shop (BitShop)



View :  Show duplicate posts
Virtual Server 2005

Recent Virtual Server 2005 posts

Virtual Server 2005 R2 SP1 over Win2003 Server 2003 R2 SP2
rebuilt hyper-v host and now cannot start vm
Represent SAN lun in Hyper-v, without exposing i to the host
Hyper-V Network with Multiple Adaptors.
Network Adapter & Legacy Network Adapter
differencing disk
VMRCPlus and Windows XP Pro SP3
VS2005 running my DC
New to VS and I have a question about 64 bit.
Emulate hyper-v
attach VS2005 vhd with scsi or IDE when vhd is on IDE
with vmrc+, do I still need IIS for VS 2005 R2 Sp1 on w2008?
Re: virtual server and ie8
Virtual Networking Problems
PRO ACCESS FLOORS
Create new volume on Hyper-V Server
Virtual Disks Trouble
Hyper-V Server need AV?
drivers on W2K8 R2 - hyper-v
Increase dynamic VHD
Add Solution

Latest Topics

Table Of Contents


Post Reply |  This is Spam! | Mark as Spam

Hyper-V Startup Script Not Working

Source: microsoft.public.virtualserver
Sent: 08/27/2009
From: Joe
Message:


I am trying to use the following vbscript to start a Win2K3 guest on a
Hyper-V server running on Win2k8. The shutdown script runs fine, but when I
run this script to startup the same VM, I get the error:

Microsoft VBScript runtime error: Object doesn't support this property or
method: 'ItemIndex'

I got this code from the Virtual PC guy's blog, and I've seen reference to
it in many places. Can you tell me why this is not working? I am running
the script from my backup server, which is Win2K3.

Thanks,
Joe

Code Snippet:
Dim VMList
Dim VMName
Dim VMGuid
Dim ShutdownList
Dim Result

'Specify the name of the virtual machine that I want to shutdown
VMName = "PrinterVM"

'Get instance of 'virtualization' WMI service on the local computer
Set WMIService = GetObject("winmgmts:\\printserver\root\virtualization")

'Query for the specific virtual machine that I want to shutdown
Set VMList = WMIService.ExecQuery("SELECT * FROM Msvm_ComputerSystem WHERE
ElementName='" & VMName & "'")

'Get the GUID for the virtual machine I want to shutdown
'VMGuid = VMList.ItemIndex(0).Name

'Query for the MSVM_ShutdownComponent that corresponds to the VM GUID that I
have
'Set ShutdownList = WMIService.ExecQuery("SELECT * FROM
Msvm_ShutdownComponent WHERE SystemName='" & VMGuid & "'")

' Request a state change on the first VM that is returned
' 2 = start, 3 = stop and 32769 = save state
VMList.ItemIndex(0).RequestStateChange(2)



Post Reply |  This is Spam! | Mark as Spam

Related Messages


Post Reply |  This is Spam! | Mark as Spam


Table Of Contents



Other groups

 
Virtual PC (Mac)(3592) Virtual PC(12844) Virtual PC (French)(496)
Virtual Server 2005(6245)
Search
in:
Our Sponsors
Virtual Server 2005 Info Here!
http://www.aspdeveloper.net
Virtual Server 2005 Info Here!
http://www.aspdeveloper.net
Virtual Server 2005 Info Here!
http://www.aspdeveloper.net
Virtual Server 2005 Info Here!
http://www.aspdeveloper.net
Virtual Server 2005 Info Here!
http://www.aspdeveloper.net
rss Wiki rss Blogs rss Articles rss Image galleries rss File galleries rss Forums rss Maps rss Directories
ASP Developer Network (since 1996) - Brought to you by Steve Radich and BitShop, Inc. - http://www.bitshop.com
Copyright © 1997-2005 by BitShop, Inc. All Rights Reserved.
No content may be reproduced in any form without written permission from BitShop, Inc.
We will be honored to assist with reproduction rights on our material if you contact us.
We also can provide print articles for your magazine, private training seminars at your site, and conference presentations.

Thank you for visiting. Please bookmark our site if you found it useful!
If you wish to make a donation it will help further the development of these free resources: