Posted On August 29, 2022

How To Use CredSSP to Move Virtual Machines In a Hyper-V Cluster

kimconnect 0 comments
blog.KimConnect.com >> Codes , Virtualization >> How To Use CredSSP to Move Virtual Machines In a Hyper-V Cluster
# Prep on Client
$domain='intranet.kimconnect.com'
Enable-WSManCredSSP -Role "Client" -DelegateComputer "*.$domain"

# Prep on Server
Enable-WSManCredSSP -Role "Server"

# Test a command the requires CredSSP
$adminUsername='intranet\brucelee'
$plaintextPassword='SOMEPASSWORD'
$encryptedPassword=ConvertTo-securestring $plaintextPassword -AsPlainText -Force
$adminCredential=New-Object -TypeName System.Management.Automation.PSCredential -Args $adminUsername,$encryptedPassword

$vmName='testWindows'
$currentNode='lax-node002'
$newOwnerNode='lax-node008'

invoke-command -computername $currentNode -credential $adminCredential -scriptblock {
		param($vmName,$newOwnerNode)
		Move-ClusterVirtualMachineRole -Name $vmName -MigrationType Live -Node $newOwnerNode
	} -Args $vmName,$newOwnerNode

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Reference Entries of Office 365 records for Internal & External DNS

General Office 365 email setup check list: MS requires that each smart-host configuration or send…

PowerShell: Disable Forticlient Web Filtering

# disableForticlientWebfiltering.ps1 # Note: untested script - use as sample as this snippet is incomplete…

PowerShell: Passing Local Functions to Remote WinRM Sessions

# Dynamic Credential Method 1 $who = whoami if ($who.substring($who.length-2, 2) -eq "-a"){$username=$who;} else {$username=$who+"-admin";}…