PowerShell script exchange
Post Reply
Posts: 482
Liked: 121 times
Joined: Aug 20, 2015 9:30 pm

Reset Hyper-V CBT with PowerShell (KB 1934)

Post by nmdange » 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 https://www.veeam.com/kb1934

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



Product Manager
Posts: 17119
Liked: 1480 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

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

Post by veremin » 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

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests