Forum Discussion
Marcel
Neophyte
Thanks, this is working now!
One more question. With the monitoring script, can you query just the concerning snapshot using a filter, instead of looping through all the snapshots? Just curious because of the possible performance impact of querying all the snapshots. So the script would be something like this:
$hostname = '##SYSTEM.HOSTNAME##';
$wildvalue = '##WILDVALUE##'
$VM = '##auto.VM.Name##'
Invoke-Command -ComputerName $hostname -ScriptBlock {
$snapshot = Get-VMSnapshot -vmname $Using:VM | ? {$_.ID -eq $Using:wildvalue}
#rest of code...
}
Anonymous
6 months agoYou can definitely do that; it would be a SCRIPT datasource (one collection task per instance) instead of a BATCHSCRIPT datasource (one collection task for all instances). Efficiency/performance reasons is the main factor in deciding between SCRIPT and BATCHSCRIPT.
Related Content
- 10 months ago
- 8 months ago