PowerShell script exchange
Post Reply
Mr Dudeman
Influencer
Posts: 20
Liked: never
Joined: Mar 08, 2017 10:19 pm
Full Name: David Dartnell
Contact:

Powershell advice required for Reset-HvVmChangeTracking cmd

Post by Mr Dudeman »

Hi All,

I am trying to flush change tracking data on a CSV by using VEEAM PowerShell; as per the following -

Reset-HvVmChangeTracking -Server [SVR_NAME] -VMName [VM_NAME]

However instead of flushing the CSV I see the message below -

Code: Select all

Reset-HvVmChangeTracking : Cannot process argument transformation on parameter 'Server'. Microsoft SQL server hosting
the configuration database is currently unavailable. Possible reasons are heavy load, networking issue, server reboot,
or hot backup.
Please wait, and try again later.
Error information:
Microsoft SQL server hosting the configuration database is currently unavailable. Possible reasons are heavy load,
networking issue, server reboot, or hot backup.
Please wait, and try again later.
Error information:
SQL server is not available
SQL server is not available
At line:1 char:34
...
Can anybody please suggest how I can go about resolving this issue?

Kind Regards,

Davo
PTide
Product Manager
Posts: 6551
Liked: 765 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Powershell advice required for Reset-HvVmChangeTracking

Post by PTide »

Hi,

Have you checked this KB already?

Thanks
Mr Dudeman
Influencer
Posts: 20
Liked: never
Joined: Mar 08, 2017 10:19 pm
Full Name: David Dartnell
Contact:

Re: Powershell advice required for Reset-HvVmChangeTracking

Post by Mr Dudeman »

Hi PTide,

Thanks for responding to my post; I am running the PowerShell commands on the Server which contains the configuration database, therefore I don't think that the KB applies.

Do you have any other suggestions?

Kind Regards,

Davo
PTide
Product Manager
Posts: 6551
Liked: 765 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: Powershell advice required for Reset-HvVmChangeTracking

Post by PTide »

So, VBR server and its configuration database are on the same server, is that correct? If so then the first thing to check is if the name of the server is resolved correctly. Also, what do you pass as SVR_NAME, is it an actual server name, or an object? You should pass the latter, if that's not the case then please check Example 1 in the documentation:
The server object is obtained with Get-VBRServer and assigned to the variable beforehand.
Thanks
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Powershell advice required for Reset-HvVmChangeTracking

Post by veremin »

Can you also try to reset CBT manually and see whether the issue is reproduced? Check the last points in this KB article. Thanks.
Mr Dudeman
Influencer
Posts: 20
Liked: never
Joined: Mar 08, 2017 10:19 pm
Full Name: David Dartnell
Contact:

Re: Powershell advice required for Reset-HvVmChangeTracking

Post by Mr Dudeman »

Hi PTide,

I had not created a 'SERVER' variable using Get-VBRServer! Doing so has fixed the issue that I was encountering.

However my new challenge is that I have too many VMs on each host to manually process (one line at a time).

For this reason I created a CSV file with all of the VMs, and now would like to use the file as an argument to the Reset-HvVmChangeTracking cmdlet.

Towards this end I created the following line of script -

Code: Select all

Reset-HvVmChangeTracking -Server $SERVER -VMName | Foreach {C:\temp\Server_Name.csv $_.Name}
However I am receiving an error message, to the effect of Specify a parameter of type 'System.String'...

I am quite new to PowerShell so this is difficult for me to resolve.

Can you offer any suggestions?

Kind Regards,

Davo
Mike Resseler
Product Manager
Posts: 8191
Liked: 1322 times
Joined: Feb 08, 2013 3:08 pm
Full Name: Mike Resseler
Location: Belgium
Contact:

Re: Powershell advice required for Reset-HvVmChangeTracking

Post by Mike Resseler »

Hi Davo,

I would create a script and do it like this:

Code: Select all

$FilePath = "locationofCSVfile"

$VMS = Import-CSV $FilePath 
ForEach ($Row in $VMS) {
Reset-HvVmChangeTracking -Server $SERVER -VMName $Row.name
}

veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Powershell advice required for Reset-HvVmChangeTracking

Post by veremin »

I don't think VMname is mandatory parameter, which means that if you just run Reset-HVVMChangeTracking without any -VMName parameter, it will reset CBT for all VMs residing on the given server.
Mr Dudeman
Influencer
Posts: 20
Liked: never
Joined: Mar 08, 2017 10:19 pm
Full Name: David Dartnell
Contact:

Re: Powershell advice required for Reset-HvVmChangeTracking

Post by Mr Dudeman »

Thanks Mike :D
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests