VMware Cloud Community
samojitd
Contributor
Contributor

Uninstall application from Linux VM using PowerCLI

Hello Team,

Looking for PowerCLI/Powershell scripts to uninstall Hardware related applications (during Post migration) from Linux VM's hosted in vSphere Infra.

The application will be like: -

1> hpsmh-7.6.0-11

2> hponcfg-4.1.0-0

etc...

Thanks,

Samojit

0 Kudos
6 Replies
LucD
Leadership
Leadership

Which Linux distro are you using? Which version?

And which PowerShell and PowerCLI version?


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

0 Kudos
samojitd
Contributor
Contributor

Hi Lucd,

RHEL 5,6,7 and for powershell version please check the attached file

pastedImage_0.png

0 Kudos
LucD
Leadership
Leadership

So, you are going to run the script from a Windows box.
And the targets are VMs with a Linux RHEL guest OS?
Are the VMware Tools installed on these VMs?


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

0 Kudos
samojitd
Contributor
Contributor

Yes I will be executing the scripts from my Win 7 VDI.

And the target VM's are RHEL OS.

And before I use the script to remove the Hardware application using script I will install the VMtools in the target RHEL VM's.

Scenario is we will be migrating 100+ RHEL Linux Physical servers to vSphere infra... and during the post migration I will installing the VM tools first then I need to remove the H/W application from all the servers since I dont want to do this task manually I was thinking if I can get some scripts to automate it.

Thanks,
Samojit

0 Kudos
LucD
Leadership
Leadership

Can I assume all the packages you mentioned earlier are were installed with a RPM package?

In that case you could use the RPM uninstall command.

rpm -e package_name

When the VMware Tools are installed in the guest OS of the target VMs, you can send that command with the Invoke-VMScript cmdlet.


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

0 Kudos
samojitd
Contributor
Contributor

Let me try that LucD ... will update you

0 Kudos