VMware Cloud Community
SK90
Enthusiast
Enthusiast

Unintall Non-MSI software from multiple VM's

Folks, I have a task in my hand to uninstall Non-MSI software from multiple VM's, but when I run below command on a particular VM to check software(Nimsoft Robot version 7.80) is installed or not it returns no value.

Get-CimInstance -ClassName Win32_Product -Filter "name like '%Nimsoft%'"

Later I understand that this command only returns value if software is installed from an MSI package. Can you  guys help me here how can I search and uninstall non-MSI package on multiple VM's using script?

11 Replies
sjesse
Leadership
Leadership

Like what, if its not a msi installed program, does it show up in add/remove programs. If not you can try and see if they have an uninstaller in the folder, if not sometimes all you need to do is delete the folder if nothing was installed in the registry. This may be a better question on a microsoft forum to get started, then we can help make sure it runs on mutliple vms.

LucD
Leadership
Leadership

Find the unins000.exe in the NimSoft folder.
Then try running 'unins000.exe /SILENT /VERYSILENT /SUPPRESSMSGBOXES' through Invoke-VMScript.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
SK90
Enthusiast
Enthusiast

How can I execute it on multiple VM's at once that count will be approx. 400 plus server

Reply
0 Kudos
sjesse
Leadership
Leadership

@Lucd probably has a better one but I do something like this, you just need the location of the exe.

$vms=Get-VM

foreach{$vm in $vms)

{

Invoke-VMScript -VM $vm -ScriptText "unins000.exe /SILENT /VERYSILENT /SUPPRESSMSGBOXES" -HostUser root -HostPassword mypass -GuestUser administrator -GuestPassword mypass

}

Reply
0 Kudos
LucD
Leadership
Leadership

First you'll need to be able to identify the VMs involved.
Then, in a loop, you call Invoke-VMScript for each of the identified VMs.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
SK90
Enthusiast
Enthusiast

Thanks Guys. I am running below command and getting highlighted error. Please suggest

Invoke-VMScript -VM $vm -ScriptText "C:\Program Files\Nimsoft\unins000.exe /SILENT /VERYSILENT /SUPPRESSMSGBOXES"

pastedImage_0.png

Reply
0 Kudos
LucD
Leadership
Leadership

When the filename contains blanks, you'll have to place it between quotes.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
SK90
Enthusiast
Enthusiast

thanks, but I see error is still coming

pastedImage_0.png

Reply
0 Kudos
SK90
Enthusiast
Enthusiast

quoted entire directory path, but still same error

pastedImage_0.png

Reply
0 Kudos
SK90
Enthusiast
Enthusiast

Thank you LucD​ and sjesse​ a lot for help. It is working now

Reply
0 Kudos
LucD
Leadership
Leadership

The default ScriptType is PowerShell, you'll have to add -ScriptType Bat


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos