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?
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.
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
How can I execute it on multiple VM's at once that count will be approx. 400 plus server
@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
}
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
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"
When the filename contains blanks, you'll have to place it between quotes.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
thanks, but I see error is still coming
quoted entire directory path, but still same error
Thank you LucD and sjesse a lot for help. It is working now
The default ScriptType is PowerShell, you'll have to add -ScriptType Bat
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference