hello guys …
im trying to uninstall a software " oracle virtualbox " so i made a simple powershell script
Invoke-Command -ScriptBlock {Get-CimInstance -ClassName Win32_Product -ComputerName (Get-Content D:\Powershell\Computernames.txt) -Filter "name like '%virtualbox%'" | Remove-CimInstance -Verbose}... but for some reason it only works if im logged on to the remote pc via Remote desktop ... though the -verbose shows that its performing some actions
VERBOSE: Perform operation 'Delete CimInstance' with following parameters, ''namespaceName' = root/cimv2,'instance' = Win32_Product: Oracle VM VirtualBox 5.1. 22 (IdentifyingNumber = "{8D5E4D4D-5E0C-4448-B018-5DDEF1E208D9}", Name = "Oracle VM VirtualBox 5.1.22", Version = "5.1.22")'. VERBOSE: Performing the operation "Remove-CimInstance" on target "Win32_Product: Oracle VM VirtualBox 5.1.22 (IdentifyingNumber = "{8D5E4D4D-5E0C-4448-B018-5D DEF1E208D9}", Name = "Oracle VM VirtualBox 5.1.22", Version = "5.1.22")". VERBOSE: Perform operation 'Delete CimInstance' with following parameters, ''namespaceName' = root/cimv2,'instance' = Win32_Product: Oracle VM VirtualBox 5.1. 22 (IdentifyingNumber = "{8D5E4D4D-5E0C-4448-B018-5DDEF1E208D9}", Name = "Oracle VM VirtualBox 5.1.22", Version = "5.1.22")'. VERBOSE: Operation 'Delete CimInstance' complete. VERBOSE: Operation 'Delete CimInstance' complete. VERBOSE: Operation 'Delete CimInstance' complete.
any help please ?