![]() In the previous article in this series I demonstrated how to use WMI to query the registry on remote computers, where I specifically showed you how to use StdRegProv. If you have solution with better performance to uninstall applications remotely, please leave a comment.Over the last several articles I’ve been guiding you on how to discover what applications might be installed. I know it’s not best solution as performance of remote connection to WMI is very slow, but it works! ![]() Write-Verbose -Verbose " - $ComputerName does not have $ApplicationName application installed!" ![]() Write-Error -Verbose " - $ComputerName uninstallation of $($application.name) failed! Error code: $($Result.ReturnValue)" Write-Verbose -Verbose " - $ComputerName uninstallation of $($application.name) successful!" $application = Get-WmiObject -Class Win32_Product -ComputerName $ComputerName -Filter "Name='$ApplicationName'" $Row = Add-ArrayRow -ServerName $ComputerName -Application $ApplicationName $Object | Add-Member -MemberType NoteProperty -Name "Application" -Value $Application $Object | Add-Member -MemberType NoteProperty -Name "ServerName" -Value $ServerName It should contains two headers: ServerName and ApplicationName. If it exist Uninstall method is used which uninstall applications.Īs an input for script CSV file should be provided. Today I’ve got for you quite easy, but very usefull script for uninstall applications on multiple machines.īelow script is using WMI objects – Win32_Product class to check if application exist on some servers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |