Powershell GPO Startup Script not working

P

pro_hdemirocak

Hello,

I wrote a Powershell Script to delete Microsoft Store Apps which works fine when run manually. However I want to run it as a Startup script via GPO on all computers (Windows 10 Pro) in our domain. For that, I created a group policy and added the script under Computer configuration>Policies>Windows settings>Scripts. There I added the powershell script on the Powershell scripts tab. I also activated Powershell scripts via Computer configuration>Administrative Templates>Windows components>Windows Powershell>Turn on Script Execution>Allow all scripts

I need the script to be run as a startup script (with system privileges) instead of a logon script as not all users have local admin rights. However the startup script doesn't work. A gpresult shows that the GPO is loaded. Is there anything I'm missing? Any help would be appreciated.


The script:

Get-AppxPackage -AllUsers *3dbuilder* | Remove-AppxPackage # 3D Builder
Get-AppxPackage -AllUsers *zunemusic* | Remove-AppxPackage # Groove Music
Get-AppxPackage -AllUsers *solitairecollection* | Remove-AppxPackage # Microsoft Solitaire Collection
Get-AppxPackage -AllUsers *messaging* | Remove-AppxPackage # Microsoft Nachrichten
Get-AppxPackage -AllUsers *stickynotes* | Remove-AppxPackage # Microsoft Sticky Notes
Get-AppxPackage -AllUsers *bingfinance* | Remove-AppxPackage # Money
Get-AppxPackage -AllUsers *zunevideo* | Remove-AppxPackage # Movies & TV
Get-AppxPackage -AllUsers *bingnews* | Remove-AppxPackage # News
Get-AppxPackage -AllUsers *onenote* | Remove-AppxPackage # OneNote
Get-AppxPackage -AllUsers *feedback* | Remove-AppxPackage # WindowsFeedbackHub
Get-AppxPackage -AllUsers *3dviewer* | Remove-AppxPackage # Microsoft3DViewer
Get-AppxPackage -AllUsers *whiteboard* | Remove-AppxPackage # Whiteboard
Get-AppxPackage -AllUsers *windowsphone* | Remove-AppxPackage # Phone Companion
Get-AppxPackage -AllUsers *photoshop* | Remove-AppxPackage # Photoshop Express
Get-AppxPackage -AllUsers *sway* | Remove-AppxPackage # Sway
Get-AppxPackage -AllUsers *bingsports* | Remove-AppxPackage # Sports
Get-AppxPackage -AllUsers *soundrecorder* | Remove-AppxPackage # Voice Recorder
Get-AppxPackage -AllUsers *bingweather* | Remove-AppxPackage # Weather
Get-AppxPackage -AllUsers *xboxapp* | Remove-AppxPackage # Xbox
Get-AppxPackage -AllUsers *xing* | Remove-AppxPackage # XING
Get-AppxPackage -AllUsers *sketchbook* | Remove-AppxPackage # Sketch Book
Get-AppxPackage -AllUsers *minecraft* | Remove-AppxPackage # Minecraft
Get-AppxPackage -AllUsers *candycrush* | Remove-AppxPackage # Candy Crush
Get-AppxPackage -AllUsers *bubble* | Remove-AppxPackage # Bubble Witch
Get-AppxPackage -AllUsers *empires* | Remove-AppxPackage # War of Lords

Continue reading...
 

Similar threads

Back
Top Bottom