SCCM removal of app-v applications from client machines script based

The standard way to remove Advertised app-v applications from client machines is to set expiration of the advertisement /deletion with setting “remove this package from client when no longer advertised” and it should work though it takes a while but this procedure doesn’t work.

Recently had an issue with App-v Applications(machines having both msi and app due to which some settings may not work ) where in these apps are not removed from client machines though advertisement is “expired” and checked “ Remove this package from client when no longer advertised” from package properties . Also deleted the advertisement to see if the app-v package disappears or not but no result.

Note : Streaming option is not enabled on DP.

Searched everywhere and tried many possibilities to make this work but did not find anything for the root cause.

So came up with simple batch script that checks if the app-v package is available on the machine or not if exist ,it will remove from the cache completely.

If you have advertisement which is still enable and run on the machine,you will be back with app-v application so ensure you expire the advertisement or not to rerun the advertisement on the machine /do not make the computer as member of app-v collection.

You can simply create program with below batch script and advertise onto collection where you don't want this app to be.

Bold Letters require changes what you need with respect to applications.

REM Script to remove the app-v applications from machine

REM Written by eskonr 19-06-2012

Set RegQry=HKLM\Hardware\Description\System\CentralProcessor\0
REG.exe Query %RegQry%  | Find /i "x86"
If %ERRORLEVEL% == 0 (
    GOTO X86
) ELSE (
    GOTO X64
)

:X86

cd "C:\Program Files\Microsoft Application Virtualization Client"

sftmime.exe remove app:"Adobe Reader" /complete

GOTO END

)

:X64

Set RegQry="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\SoftGrid\4.5\Client\Applications\Adobe Reader"
REG.exe Query %RegQry% | Find /i "Adobe Reader"
If %ERRORLEVEL% == 0 (
cd "C:\Program Files (x86)\Microsoft Application Virtualization Client"

sftmime.exe remove app:"Adobe Reader" /complete

GOTO END

)

:END

if you have any other better way to do this or why standard way doesn't work ,please post your comments.

Hope it helps someone who is having similar issue :).

3 Responses to "SCCM removal of app-v applications from client machines script based"

Leave a Reply