首页 » ASP代码 » VBS获取hyper-v虚拟主机的运行状态

VBS获取hyper-v虚拟主机的运行状态

'可以通过WMI来操作和获取Hyper-V的信息,这些方法怎么查怎么用,需要用相应工具和阅读
'以下代码演示了得到一个虚拟主机的状态是什么。2运行中3关闭32768暂停,其他自己测试
vmName="192.168.8.80"
Set VMobject=GetObject("winmgmts:\\.\root\virtualization")
set vmSets=VMobject.ExecQuery("select * from msvm_ComputerSystem where ElementName='" & vmName & "'")
if vmSets.count=1 then
  Set getVM=vmSets.ItemIndex(0)
  vmState=getVM.EnabledState
End If
Set vmSets=Nothing : Set VMobject=Nothing
wscript.echo  vmState

, , , ,

转发到新浪微博 转发到新浪微博

目前这篇文章有4条评论(Rss)

  1. full izle | #1
    05/16/2012 at 09:17

    oh my god amazing post admin will verify your web site generally

  2. hotel a valmontone | #2
    05/16/2012 at 11:05

    Hi! I’ve been reading your site for a while now and finally got the courage to go ahead and give you a shout out from Houston Tx! Just wanted to tell you keep up the fantastic work!

  3. zinc | #3
    05/16/2012 at 19:05

    Another very entertaining post. Ive been reading through some of your posts and finally decided to drop a comment on this one. Please feel free to visit my site Doppler

  4. Tyson F. Gautreaux | #4
    05/17/2012 at 05:04

    Finally found a customer service page please close my account i dont recive refunds when i return merchandise i gave these packages to the postman i dont have a tracking no.one item was the evil eye pendant and the other was the fake lv bag which seller claimed to be authentic i am not comfortable with ebay sellers i continue to get ripped off i would rather pay full price than purchase from ebay close immediatley i feel ebay is hoorible.

我要评论