PROBLEM: Can’t control Windows 2012 Hyper-V server through
PowerShell, error returned is
“The Hyper-V module used in this Windows
PowerShell session cannot be used for remote management of the server”
CAUSE: Unlike most PowerShell modules, the Hyper-V module
that ships with Server 2016 is NOT backwards compatible.
SOLUTION: you
have to load the downlevel version in your script with this command:
Import-Module Hyper-V -RequiredVersion 1.1
NOTE: The current version must be unloaded before
calling the new module:
Remove-Module Hyper-V
Remove-Module Hyper-V
You must remove
whatever version is loaded when switching back and forth between version.
Trying to load
a different version of the same module without unloading the module in memory results
in a screen of red loading errors.
Note: It appears a reboot may be required to access
the downlevel version after installing the Hyper-V remote server admins tools
through Roles & Features. I do not have the ability to test or confirm this
at this time.
Microsoft support was not much help on this one, thought i might save someone some trouble