Reset Hyper-V CBT with PowerShell (KB 1934)

PowerShell script exchange

Reset Hyper-V CBT with PowerShell (KB 1934)

Veeam Logoby nmdange » Thu Jul 28, 2016 3:51 pm 1 person likes this post

Recently had a support case that required resetting the CBT data on Hyper-V per this KB article

Since I have a large environment, doing this procedure manually on a lot of hosts was a bit of a pain, so I wrote some PowerShell to do it

I hard-coded the server names. If anyone wants to go a step further and update the script o pull the server list from Veeam, feel free :mrgreen:

Code: Select all
$servers = `

foreach($s in $servers)
Write-Output "Clearing CBT on " $s

Invoke-Command -ComputerName $s -ScriptBlock {
Stop-Service VeeamFCT
if(Test-Path "C:\veeamctdb.reg")
Remove-Item "C:\veeamctdb.reg" -Confirm:$false
reg export "HKLM\SYSTEM\CurrentControlSet\Services\VeeamFCT\Parameters\CTDB" C:\veeamctdb.reg
Remove-Item -Path "HKLM:SYSTEM\CurrentControlSet\Services\VeeamFCT\Parameters\CTDB" -Recurse -Confirm:$false
Start-Service VeeamFCT



Posts: 244
Liked: 61 times
Joined: Thu Aug 20, 2015 9:30 pm

Re: Reset Hyper-V CBT with PowerShell (KB 1934)

Veeam Logoby v.Eremin » Thu Jul 28, 2016 4:34 pm

Thank you for sharing your code; highly appreciated.

As to getting Hyper-V servers names automatically, the following one-liner might meet your expectations:

Code: Select all
$Servers = ((Get-VBRServer) | where {$_.Type -eq "HvServer"}).name
Veeam Software
Posts: 14035
Liked: 1051 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Return to PowerShell

Who is online

Users browsing this forum: No registered users and 1 guest