question

JacquesScheepers-0668 avatar image
0 Votes"
JacquesScheepers-0668 asked GonzaloMB-4342 published

delete antivirusproduct instance using wmi

Good day.

I hope you are keeping well.

I'm a complete noob when it comes to powershell scripting and am still learning.

I am able to delete the instance manually using wbemtest but I'm struggling to put that into powershell.

Attached is a screenshot of wbemtest where i am able to delete the instance.

Here is where i am with powershell: Remove-WmiObject -Namespace root/securitycenter2 -class AntivirusProduct.instanceGuid="{Antivirus key}"

The above command does not work.

Please note below command can be harmfull:
Remove-WmiObject -Namespace root/securitycenter2 -class AntivirusProduct

The above command deleted the entire Antivirusproduct class. I only need to delete an instance/key in antivirusproduct.

The reason for the powershell script is that an antivirusproduct is stuck in security center and is causing the new antivirusproduct to snooze/not run because the primary antivirus is still set to the old antivirus. We need to run the command on 750 computers and I prefer not to do it manually with wbemtest.

Please let me know if you need more information or if you know where i might get an answer.

Thank you in advance186391-2022-03-24-08-32-02-testvm-on-cnd51322nw-nb-1-virt.png


windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JacquesScheepers-0668 avatar image
0 Votes"
JacquesScheepers-0668 answered

After clicking on the instance in wbemtest i found the path of the product

Solution:
Remove-WmiObject -path \\localhost\ROOT\securitycenter2:AntivirusProduct.instanceGuid="{product key}"

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

GonzaloMB-4342 avatar image
0 Votes"
GonzaloMB-4342 answered GonzaloMB-4342 published

Thank you for this, bet you're dealing with Webroot SecureAnywhere

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.