• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 159
  • Last Modified:

Get-AppxPackage all users.

Is there any command for the following: for all users not just the user logged in .  And in addition is there a way to default IE for all users and not just one person at a time?
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
Get-AppxPackage *windowsalarms* | Remove-AppxPackage
Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage *officehub* | Remove-AppxPackage
Get-AppxPackage *skypeapp* | Remove-AppxPackage
Get-AppxPackage *getstarted* | Remove-AppxPackage
Get-AppxPackage *zunemusic* | Remove-AppxPackage
Get-AppxPackage *windowsmaps* | Remove-AppxPackage
Get-AppxPackage *solitairecollection* | Remove-AppxPackage
Get-AppxPackage *bingfinance* | Remove-AppxPackage
Get-AppxPackage *zunevideo* | Remove-AppxPackage
Get-AppxPackage *bingnews* | Remove-AppxPackage
Get-AppxPackage *onenote* | Remove-AppxPackage
Get-AppxPackage *people* | Remove-AppxPackage
Get-AppxPackage *windowsphone* | Remove-AppxPackage
Get-AppxPackage *windowsstore* | Remove-AppxPackage
Get-AppxPackage *bingsports* | Remove-AppxPackage
Get-AppxPackage *soundrecorder* | Remove-AppxPackage
Get-AppxPackage *bingweather* | Remove-AppxPackage
Get-AppxPackage *xboxapp* | Remove-AppxPackage
Get-AppxPackage *king.com.CandyCrushSodaSaga* | Remove-AppxPackage
Get-AppxPackage *bingsports* | Remove-AppxPackage
Get-AppxPackage *Office.sway* | Remove-AppxPackage
Get-AppxPackage *Twitter* | Remove-AppxPackage
Get-AppxPackage *Bing* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Messaging* | Remove-AppxPackage
Get-AppxPackage *Microsoft.BingFinance* | Remove-AppxPackage
Get-AppxPackage *Microsoft.WindowsScan* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Reader* | Remove-AppxPackage
Get-AppxPackage *Microsoft.CommsPhone* | Remove-AppxPackage
Get-AppxPackage *Microsoft.ConnectivityStore* | Remove-AppxPackage
Get-AppxPackage *Microsoft.WindowsReadingList* | Remove-AppxPackage
0
WellingtonIS
Asked:
WellingtonIS
  • 11
  • 7
  • 4
  • +1
1 Solution
 
Cliff GaliherCommented:
You can remove the provisioning package which will prevent the apps from  ring installed for NEW user accounts.  But there is no command to retroactively remove apps from every user. You'd usually customize the default profile before deployment if that is needed.

Same with default browser, mail etc.
0
 
WellingtonISAuthor Commented:
not the answer I was hoping for...
0
 
Cliff GaliherCommented:
You could use a login script. You're in a bit of a race condition with the user if they open an app,  but it is doable. Or just leave the apps and let the user choose to use them, Uninstall them, etc. That's my preferred approach.
0
WEBINAR: 10 Easy Ways to Lose a Password

Join us on June 27th at 8 am PDT to learn about the methods that hackers use to lift real, working credentials from even the most security-savvy employees. We'll cover the importance of multi-factor authentication and how these solutions can better protect your business!

 
WellingtonISAuthor Commented:
I can't do that not in this environment.  I have a list of apps I need to uninstall
0
 
Cliff GaliherCommented:
In restrictive environments then, the best approach is to standardize your image pre-employment. That's the only 100% surefire way, and is usually what secure environments demand anyways. I've done my fair share of those.
0
 
WellingtonISAuthor Commented:
We have this however, this is in case we need to do something from scratch.  Thanks.
0
 
WellingtonISAuthor Commented:
Is there a way to create a batch file to run from startup?
0
 
WellingtonISAuthor Commented:
OK I created removeapps.ps1 and I'm trying to create a scheduled task to run this.  It's just not working no matter what I try.  HELP!
0
 
Cliff GaliherCommented:
Scheduled tasks run in the wrong context. Like I said, you'd have to do this with a login script and hope the user doesn't use or launch something that breaks it.
0
 
WellingtonISAuthor Commented:
You mean like in a GPO?
0
 
WellingtonISAuthor Commented:
Here's the answer:
in task scheduler run the following: Step 1
PowerShell.exe -windowstyle hidden set-excutionpolicy remotesigned
Step 2 you need to create a second task to run 30 seconds later:
PowerShell.exe -windowstyle hidden path to your ps1 file.
this works
0
 
Shaun VermaakTechnical Specialist/DeveloperCommented:
-AllUsers
AllUsers.png
0
 
Cliff GaliherCommented:
-allusers is not a valid option for that cmdlet.

https://technet.microsoft.com/en-us/library/hh856038.aspx
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Sorry WellingtonIS, but no, #a42514915 does not work. You need to do that for each and every person logging in, inside their user context, and that again requires to create the task for every user!
Also, doing that two-step process is not required at all, you can set the execution policy when starting PowerShell (as a parameter). Setting the execution policy as you showed will not work because it asks for confirmation, which cannot be given because the window is hidden.
Did you really test your "solution"?
0
 
WellingtonISAuthor Commented:
Yes In windows 10 you can have the task run for all users.  I've tested it with 3 different users so far.  Powershell runs and the apps are deleted.
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Cliff, you need to look at the current doc of the cmdlet, not the old one for W8: https://docs.microsoft.com/en-us/powershell/module/appx/remove-appxpackage?view=win10-ps
0
 
WellingtonISAuthor Commented:
OK when you create a scheduled task with windows 10 you have the option of changing the settings:  See attached and it will run for all users. That's how I did it.  So each time any user logs in that script will run.
allusers.png
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
I've checked that option, and yes, you can run a single task for all users that way. But the account you run the task with (and which is static) determines the profile it runs in, so the task is always executed with the task's account. Test with
powerhsll -command "write-output $env:username | Out-File  C:\Temp\username.txt"

Open in new window

as action, and see what is in C:\Temp\username.txt ...
Because of that, I doubt that it really works.
0
 
WellingtonISAuthor Commented:
OK will do but all I can tell you is somehow the apps disappeared...  So I'm not sure. Where should I run this?  If I just run this command it errors.
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
Run it as a task configured as the other one, and either log in or trigger it manually.
0
 
Cliff GaliherCommented:
I stand corrected. Good to know.
0
 
Shaun VermaakTechnical Specialist/DeveloperCommented:
-allusers is not a valid option for that cmdlet.
That what autocomplete Cliff, I did not type it out
0
 
Cliff GaliherCommented:
@shaun : Understood.  I was looking at old documentation and missed that the new option was added in later releases.  Learn something new every day. Also makes what the OP wants to do pretty easy.  Though I was wrong, I'm glad you posted it and that QLemo posted the updated docs.  It updates my knowledge, which is never a bad thing.
0
 
WellingtonISAuthor Commented:
I figured it out.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

WEBINAR: 10 Easy Ways to Lose a Password

Join us on June 27th at 8 am PDT to learn about the methods that hackers use to lift real, working credentials from even the most security-savvy employees. We'll cover the importance of multi-factor authentication and how these solutions can better protect your business!

  • 11
  • 7
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now