Reset-HvVmChangeTracking cmdlet - remove ALL

PowerShell script exchange

Reset-HvVmChangeTracking cmdlet - remove ALL

Veeam Logoby spgsit5upport » Thu May 21, 2015 1:36 pm

As this cmdlet does not accept wildcard *, does anybody have a script that does resets tracking for ALL VMs on any given host?

Thanks

Seb
spgsit5upport
Expert
 
Posts: 182
Liked: 14 times
Joined: Fri May 28, 2010 10:25 am
Full Name: Seb

Re: Reset-HvVmChangeTracking cmdlet - remove ALL

Veeam Logoby v.Eremin » Thu May 21, 2015 2:19 pm

May be something like this will answer your requirements?

Code: Select all
foreach ($Server in (Get-VBRServer | where {$_.Type -eq "HvServer"}))
{
Reset-HvVmChangeTracking -Server $Server
}


Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Reset-HvVmChangeTracking cmdlet - remove ALL

Veeam Logoby spgsit5upport » Thu May 21, 2015 2:40 pm

But Reset-HvVmChangeTracking also requires -VMName parameter (which can not be * )
spgsit5upport
Expert
 
Posts: 182
Liked: 14 times
Joined: Fri May 28, 2010 10:25 am
Full Name: Seb

Re: Reset-HvVmChangeTracking cmdlet - remove ALL

Veeam Logoby v.Eremin » Thu May 21, 2015 4:05 pm

Then, additional loop is required; give a shot to the following example (unfortunately, can't test it myself at the moment):

Code: Select all
foreach ($Server in (Get-VBRServer | where {$_.Type -eq "HvServer"}))
{
foreach ($VM in (Find-VBRHvEntity -Server $Server | where {$_.Type -eq "VM"}))
{
Reset-HvVmChangeTracking -Server $Server -VMname $VM.name
}
}

Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Reset-HvVmChangeTracking cmdlet - remove ALL

Veeam Logoby spgsit5upport » Fri May 22, 2015 8:39 am

Perfect, thanks

Seb
spgsit5upport
Expert
 
Posts: 182
Liked: 14 times
Joined: Fri May 28, 2010 10:25 am
Full Name: Seb

Re: Reset-HvVmChangeTracking cmdlet - remove ALL

Veeam Logoby v.Eremin » Fri May 22, 2015 9:37 am

You're welcome. Let me know, if you need other assistance with scripting. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: Bing [Bot] and 2 guests