Jump to content

Search the Community

Showing results for tags 'Hyper-V VM'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hello everyone Just wondering if anyone has ventured into Backing up Hyper-V Vm machines. I'm wanting to shutdown the VM.. Check its status via Ping or a response from the Hyper-V manager that its fully off and then do a copy to a network drive. Finish the copy and start the machine back up.. Now the status, Shutdown and Startup is my main challenge. Any susgesstions ?? Trying to keep it as simple as possible. I will add some loggin , email functionality etc.. Dim $WMIService Dim $VMList Dim $VMGuid Dim $ShutdownList Dim $Result $VMName = "VM2011" _ShutdownVM($VMName) Func _ShutdownVM($VMName) $WMIService = ObjGet("winmgmts:\\.\root\virtualization") $VMList = $WMIService.ExecQuery("SELECT * FROM Msvm_ComputerSystem WHERE ElementName='" & $VMName & "'") $VMGuid = $VMList.ItemIndex(0).Name MsgBox(0, "VM GUID", $VMGuid) $ShutdownList = $WMIService.ExecQuery("SELECT * FROM Msvm_ShutdownComponent WHERE SystemName='" & $VMGuid & "'") $Result = $ShutdownList.ItemIndex(0).InitiateShutdown(True, "Because I said so") EndFunc ;==>_ShutdownVM Func _StartupVM($VMName) $WMIService = ObjGet("winmgmts:\\.\root\virtualization") $VMList = $WMIService.ExecQuery("SELECT * FROM Msvm_ComputerSystem WHERE ElementName='" & $VMName & "'") ; Request a state change on the first VM that is returned' 2 = start, 3 = stop and 32769 = save state $VMList.ItemIndex(0).RequestStateChange(2) EndFunc ;==>_StartupVM
×
×
  • Create New...