mczerniawski / mczerniawski.github.io

my public page
MIT License
1 stars 0 forks source link

azure/microsoft-monitoring-agent-clear-take-2/ #11

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Microsoft Monitoring Agent - Clear cache and HybridWorker Group - Mateusz Czerniawski

When clearing the cache is not enough. Kill it with fire

https://www.mczerniawski.pl/azure/microsoft-monitoring-agent-clear-take-2/

maksce commented 2 years ago

I'm receiving this error, can you please help me? Also are you running this on one of the affected VM's or on your pc?

Invoke-Command : Cannot validate argument on parameter 'ComputerName'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At line:22 char:30

mczerniawski commented 2 years ago

You get this error cause there's nothing in $servers variable. It's depends on the result of $workers: $servers = (($workers | where-object {$PSItem.RunbookWorker.LastSeenDateTime -le $date}).RunbookWorker).Name

If there are no staled workers evaluated - it has nowhere to connect to - and that is why you have an error.