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
WellingtonISAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Check Out How Miercom Evaluates Wi-Fi Security!

It's not just about Wi-Fi connectivity anymore. A wireless security breach can cost your business large amounts of time, trouble, and expense. Plus, hear first-hand from Miercom on how WatchGuard's Wi-Fi security stacks up against the competition plus a LIVE demo!

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Shaun VermaakTechnical SpecialistCommented:
-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
Qlemo"Batchelor", 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
Qlemo"Batchelor", 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
Qlemo"Batchelor", 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
Qlemo"Batchelor", 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 SpecialistCommented:
-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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.