-
- Expert
- Posts: 221
- Liked: 16 times
- Joined: May 28, 2010 10:25 am
- Full Name: Seb
- Contact:
Reset-HvVmChangeTracking cmdlet - remove ALL
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
Thanks
Seb
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Reset-HvVmChangeTracking cmdlet - remove ALL
May be something like this will answer your requirements?
Thanks.
Code: Select all
foreach ($Server in (Get-VBRServer | where {$_.Type -eq "HvServer"}))
{
Reset-HvVmChangeTracking -Server $Server
}
-
- Expert
- Posts: 221
- Liked: 16 times
- Joined: May 28, 2010 10:25 am
- Full Name: Seb
- Contact:
Re: Reset-HvVmChangeTracking cmdlet - remove ALL
But Reset-HvVmChangeTracking also requires -VMName parameter (which can not be * )
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Reset-HvVmChangeTracking cmdlet - remove ALL
Then, additional loop is required; give a shot to the following example (unfortunately, can't test it myself at the moment):
Thanks.
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
}
}
-
- Expert
- Posts: 221
- Liked: 16 times
- Joined: May 28, 2010 10:25 am
- Full Name: Seb
- Contact:
Re: Reset-HvVmChangeTracking cmdlet - remove ALL
Perfect, thanks
Seb
Seb
-
- Product Manager
- Posts: 20415
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: Reset-HvVmChangeTracking cmdlet - remove ALL
You're welcome. Let me know, if you need other assistance with scripting. Thanks.
Who is online
Users browsing this forum: No registered users and 5 guests