Windows 10: Powershell GPO Startup Script not working

Discus and support Powershell GPO Startup Script not working in AntiVirus, Firewalls and System Security to solve the problem; 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... Discussion in 'AntiVirus, Firewalls and System Security' started by pro_hdemirocak, Mar 10, 2020.

  1. Powershell GPO Startup Script not working


    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

    :)
     
    pro_hdemirocak, Mar 10, 2020
    #1
  2. DwayneD1 Win User

    Deploying Powershell Script via GPO on Win Server 2008 R2

    Hi Everyone,

    I'm trying to deploy a PS script via GPO.

    I've tried to deploy it as a logon script and separately as a startup script.

    It does not seem to execute the script.

    When I try to run the script on my own machine I receive the following message:

    Set-ExecutionPolicy : Windows PowerShell updated your execution policy successfully, but the setting is overridden by

    a policy defined at a more specific scope. Due to the override, your shell will retain its current effective

    execution policy of RemoteSigned. Type "Get-ExecutionPolicy -List" to view your execution policy settings. For more

    information please see "Get-Help Set-ExecutionPolicy".

    At line:1 char:46

    + ... -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '\ ...

    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo : PermissionDenied: Powershell GPO Startup Script not working :)) [Set-ExecutionPolicy], SecurityException

    + FullyQualifiedErrorId : ExecutionPolicyOverride,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand

    When I elevate the permissions to admin, it works and I can run the script manually on the machine.

    Is there any way in which I can deploy this so that it runs with elevated admin permissions?

    Or is there something I need to change or add in order for this to run?

    Thanks
     
    DwayneD1, Mar 10, 2020
    #2
  3. GPOs not running logon scripts

    Greetings,

    we have an environment of 2 DCs running WS 2008R2 and applying several GPOs. The GPOs that have a user logon script (vbs or ps1) can not run. At the same time, if we run the vbs scripts from a pc on the domain they run successfully. Any suggestions would
    be appreciated!

    Thanking you in advance.
     
    Eleftheria Siachalou, Mar 10, 2020
    #3
  4. sachind1 Win User

    Powershell GPO Startup Script not working

    script running on Startup and Shutdown of System is not working

    Steps

    • Open a run box
    • type in "gpedit.msc"
    • Expand Computer Configuration
    • Expand Windows Settings
    • Select Scripts (Startup/Shutdown)
    • Double click Startup
    • Click Show Files and copy/paste your file in to this folder
    • Click the Add button on the startup properties
    • Click Browse and double click on your script to choose it.
    • "OK" out of all windows to apply the new settings.
    I am generally Giving Path of My python to the startup and shutdown as steps given above
     
    sachind1, Mar 10, 2020
    #4
Thema:

Powershell GPO Startup Script not working

Loading...
  1. Powershell GPO Startup Script not working - Similar Threads - Powershell GPO Startup

  2. How to apply the GPO settings by using PowerShell scripts.

    in Windows 10 Gaming
    How to apply the GPO settings by using PowerShell scripts.: Hello Team,We required your help to create the GPO settings via PowerShell script. example : I would like to apply the GPO settings to turn of the handwriting recognition error reporting via from PowerShell.I know how to apply the settings by manually to navigate the path...
  3. How to apply the GPO settings by using PowerShell scripts.

    in Windows 10 Software and Apps
    How to apply the GPO settings by using PowerShell scripts.: Hello Team,We required your help to create the GPO settings via PowerShell script. example : I would like to apply the GPO settings to turn of the handwriting recognition error reporting via from PowerShell.I know how to apply the settings by manually to navigate the path...
  4. windows powershell script not working.

    in Windows 10 Gaming
    windows powershell script not working.: Hallo!Problem: I wan´t to use a script to turn on autohide taskbar in desktop mode.if I put in: " powershell -command "&{$p='HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3';$v=Get-ItemProperty -Path $p.Settings;$v[8]=3;&Set-ItemProperty -Path $p -Name...
  5. windows powershell script not working.

    in Windows 10 Software and Apps
    windows powershell script not working.: Hallo!Problem: I wan´t to use a script to turn on autohide taskbar in desktop mode.if I put in: " powershell -command "&{$p='HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3';$v=Get-ItemProperty -Path $p.Settings;$v[8]=3;&Set-ItemProperty -Path $p -Name...
  6. windows powershell script not working.

    in Windows 10 Customization
    windows powershell script not working.: Hallo!Problem: I wan´t to use a script to turn on autohide taskbar in desktop mode.if I put in: " powershell -command "&{$p='HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3';$v=Get-ItemProperty -Path $p.Settings;$v[8]=3;&Set-ItemProperty -Path $p -Name...
  7. PowerShell script

    in Windows 10 Support
    PowerShell script: The code below tests a series of IPs in a txt file.The result is as follows and is written in a txt file. 19.191.12.161 - online 19.191.12.162 - offline 19.191.12.163 - offline 19.191.12.164 - offline 19.191.12.165 - offline also see the scrennshot Code: $Output= @()$GetIP =...
  8. powershell scripts

    in AntiVirus, Firewalls and System Security
    powershell scripts: Hi, I have azure. Someone is somehow installing powershell scripts onto my computer that allows them to host my PC through P2P and UDP connections, well I think so anyway. I have only just found powershell script entry changes in my registry by accident. These criminals...
  9. powershell script

    in Windows 10 Customization
    powershell script: looking for a script to monitor for a folder, if there is a file in that folder send it as an email, once the email is sent out, confirm and then move the files to an archive folder. monitor c:\test\*.pdf No files, do not send email. Yes Files, send an email to someone at...
  10. PowerShell scripts not working with Call operator

    in Windows 10 BSOD Crashes and Debugging
    PowerShell scripts not working with Call operator: Hello I have been developing a Powershell script using Powershell ISE, and for the most part i am very happy about it, however i have encountered what i believe to be a bug in the call operator (&). When i use the call operator followed by a "pure" string everything works...