I was most probably not clear enough. Let me try to explain you this in a better way.
A customer deploys a VM (from a Portal, deployment is automated) and the customer's VM gets monitored by SCOM. So when the customer decides that the VM is not needed anymore, as part of the undeployment process the SCOM Agent is removed (Remove-SCXAgent for Linux, for Windows using the script, mentioned here:
https://blog.pohn.ch/automating-the-sco ... owershell/
My Problem is that when the Agent is removed from SCOM I have a Veeam VM Container object left, which then alerts as unavailable and causes confusion.
So I Need to get rid of this VM Container object (class Veeam.Virt.Extensions.VMware.VMGUEST) at the time of the undeployment of the VM, the same way I do with the standard objects from class System.Computer.
So I could disable the disocvery for this particular VM Container object (using PowerShell), but then I will have to run Remove-SCOMDisabledClassInstance as part of the undeployment and this particular cmdlet (as described in the blog above) cannot be automated, because of its prompt.
Any ideas? Big thanks in advance.