保存更改,然后退出记事本。再次导入修改后的虚拟机。如果要自动解决此问题,可以在将虚拟机导入 Hyper-V 服务器之前在 Hyper-V 服务器上运行 Visual Basic 脚本:Option Explicit
Dim WMIService
Dim VMList
Dim VM
Dim VMSystemGlobalSettingData
Dim VMManagementService
Dim Result
'Get instance of 'virtualization' WMI service on the local computer
Set WMIService = GetObject("winmgmts:\\.\root\virtualization")
'Get a VMManagementService object
Set VMManagementService = WMIService.ExecQuery("SELECT * FROM Msvm_VirtualSystemManagementService").ItemIndex(0)
'Get all the MSVM_ComputerSystem object
Set VMList = WMIService.ExecQuery("SELECT * FROM Msvm_ComputerSystem")
For Each VM In VMList
if VM.Caption = "Virtual Machine" then
Set VMSystemGlobalSettingData = (VM.Associators_("MSVM_ElementSettingData", "Msvm_VirtualSystemGlobalSettingData")).ItemIndex(0)
VMSystemGlobalSettingData.ScopeOfResidence = ""
Result = VMManagementService.ModifyVirtualSystem(VM.Path_.Path, VMSystemGlobalSettingData.GetText_(1))
end if
Next 这样就可以完美解决导入虚拟机0x80070057错误问题">
尝试导入已使用 Hyper-V 管理器导出的虚拟机时,无法通过在其他服务器上的Hyper-V管理器导入虚拟机。
而且还会收到如下所示的错误消息:
尝试导入虚拟机时出现服务器错误。 未能从导入目录<>路径导入虚拟机。 错误:一个或多个参数无效 (0x80070057) 。
若要解决此问题,请按照下列步骤操作:
<PROPERTY NAME="ScopeOfResidence" TYPE="string">
<VALUE>
222dea57-bedd-465c-8fe4-54f2ad7ae699 ** => DELETE THIS GUID**
</VALUE>
</PROPERTY>
如果要自动解决此问题,可以在将虚拟机导入 Hyper-V 服务器之前在 Hyper-V 服务器上运行 Visual Basic 脚本:
Option Explicit
Dim WMIService
Dim VMList
Dim VM
Dim VMSystemGlobalSettingData
Dim VMManagementService
Dim Result
'Get instance of 'virtualization' WMI service on the local computer
Set WMIService = GetObject("winmgmts:\\.\root\virtualization")
'Get a VMManagementService object
Set VMManagementService = WMIService.ExecQuery("SELECT * FROM Msvm_VirtualSystemManagementService").ItemIndex(0)
'Get all the MSVM_ComputerSystem object
Set VMList = WMIService.ExecQuery("SELECT * FROM Msvm_ComputerSystem")
For Each VM In VMList
if VM.Caption = "Virtual Machine" then
Set VMSystemGlobalSettingData = (VM.Associators_("MSVM_ElementSettingData", "Msvm_VirtualSystemGlobalSettingData")).ItemIndex(0)
VMSystemGlobalSettingData.ScopeOfResidence = ""
Result = VMManagementService.ModifyVirtualSystem(VM.Path_.Path, VMSystemGlobalSettingData.GetText_(1))
end if
Next
这样就可以完美解决导入虚拟机0x80070057错误问题