PoSh script to add existing Windows 2012 R2 cluster to SCVMM 2012 R2

We are all trying to automate something, aren’t we?! Here’s a quick one I did to add an existing cluster to SCVMM 2012 R2:

Clear-Host
$credential = Get-Credential -Message "enter in your admin account"
$clustername = Read-Host "enter in cluster name (not the FQDN)"

Add-SCVMHostCluster -Name $clustername -RunAsynchronously -RemoteConnectEnabled $true -Credential $credential
sleep -Seconds 600
Get-SCVMHostCluster $clustername | Move-SCVMHostCluster -ParentHostGroup <name of your host group>

Write-Host " Done ! Scrollup and check for any errors, if not follow job in SCVMM " -BackgroundColor Magenta
pause

Leave a Comment

Your email address will not be published.