Remove App-V 5.0 package from Remote Computer

Tagged: , ,

This topic contains 3 replies, has 2 voices, and was last updated by Profile photo of Gyan Gyan 1 year, 11 months ago.

  • Author
    Posts
  • #21262
    Profile photo of Gyan
    Gyan
    Participant

    Hi,

    I can remove App-V 5.0 application from a local computer by using the Cmdlet Remove-AppVClientPackage. But this cmdlet doesn't accept any parameter as -ComputerName, which means it cannot be executed on a Remote Computer. I know this can be done by running it within the Script block of Invoke-Command but that requires PSRemoting to be enabled which is disabled in our environment.

    I have even tried the below WMI command but pipeline doesn't seems to work with this Cmdlet.

    Get-WmiObject -ComputerName $ComputerName -Namespace Root\APPV -Class AppvClientPackage | Where-Object {$_.Name -eq 'Application name'} | Remove-AppvClientPackage

    I would like to know if there is any other way to send the command to be executed on a Remote Computer?

  • #21264
    Profile photo of Tim Pringle
    Tim Pringle
    Participant

    Hey Gyan,

    Not used it myself, but you should be able to spark it off by invoking a PowerShell process via WMI, using the Create method of Win32_Process.

    Details of Win32_Process you can find here:

    [url]http://msdn.microsoft.com/en-us/library/aa394372%28v=vs.85%29.aspx[/url]

    In meantime, I'll try and dig out the actual syntax you need, because you need the remote process to actually invoke powershell.exe and then run the required commands. Can't recall off the top of my head the exact way it needs to be written.

    cheers,

    Tim

  • #21267
    Profile photo of Gyan
    Gyan
    Participant

    Hello Tim,

    Thanks for your response. Using Win32_Process seems to be a good idea. I will try this and see if it helps.

    Cheers,

    Gyan

  • #21338
    Profile photo of Gyan
    Gyan
    Participant

    Thanks Tim,

    The Create method of Win32_Process worked like a charm. Below is the command I used to achieve it:

    $Process = [WMICLASS]"\\$ComputerName\root\cimv2:Win32_Process"
    $Process.Create("PowerShell.exe Remove-AppvClientPackage $PackageName")

    Cheers,

    Gyan

You must be logged in to reply to this topic.