Jump to content


mcbla

Windows 8.1 application & tile removal using Powershell via SCCM 2012

Recommended Posts

Hello,

 

I have sourced a powershell script which removes Windows 8.1 applications and the tile ( appx )

 

If I run the script manually on a client the script runs and removes the application tile from the metro screen. I have altered the script a few times to remove multiple application tiles at once and that worked fine as well.

 

I have created a program in SCCM 2012 and deployed to a client.

 

The EXECMGR log file tells me the script is received by the client and has run successfully, exit code = 0, the execution status is Success.

 

But I can still see the tile on the metro screen and the app content in c:\program files\windows apps

 

The script is as below -

 

$AppsToDelete="*Microsoft.WindowsReadingList*"
Foreach ($AppName in $AppsToDelete)
{
get-appxprovisionedpackage -online | where packagename -like $AppName | remove-appxprovisionedpackage -Online
Get-AppxPackage -name $AppName -allusers | Remove-AppxPackage
}

 

The program used by SCCM2012 to execute the script is as follows -

 

PowerShell.exe -ExecutionPolicy UnRestricted -File .\delappsreadinglistonly.ps1

 

Can anyone offer clues or pointers about what to do next ?

 

My skills with Powershell are minimal !

 

Thanks...

Share this post


Link to post
Share on other sites

are you running the script as system or as the logged in user, by the sounds of it you are running it as system when you should be running it as the logged in user...

Share this post


Link to post
Share on other sites

Hello,

 

Thanks for the tip.

 

Yes, the script was running in the system context as is often the case with SCCM 2012.

 

Here's the change that I made.

 

For my program properties, under environment, I have changed the ' run mode ' to ' run with user's rights '

 

Looking at EXECMGR log, I see the program is executed in the user context.

 

I also see the program runs and succeeds, with exit code 0

 

That said, the Reading List tile is no longer on the start screen, but the Reading List app still appears in the Apps by name alphabetical list and can be executed.

 

Who would have thought this is such a rigmarole ?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.