none
Powershell Startup Script GPO Not yet been run RRS feed

  • Question

  • Hi Guys and Gals,

    I would really appreciate some help on this one, i am learning power shell but actually being able to execute scripts on start up woudl help a lot on this.

    We have server 2012 R2 and Windows 8.1 machines SCCM configured pretty well.

    We are trying to find a work around for a buggy load of samsung tablets which have a wireless adapter which only seems to work by disabling and enabling. Once you reboot it shows as being active in Deivce Manager but only is able to work (no SSID's appear) once you disable/enable, So i came up with the workaround of a powershell startup script to disable and enable the adapter, this works from the shell in theory if you run it as admin, it basically is this:

    disable-netadapter wifi -Confirm:$false

    enable-netadapter wifi -Confirm:$false

    Works a treat once you have logged in but we need it to run pre-logon otherwise obviously we will have mobile DC Synch issues if we attempt to issue any.

    We have copied it to the sysvol folder, checked the Domain Computers security group is added. Moved it to the sys32 folder on the local box to test, still not executing, also added in 'set-execution policy bypass, still nothing on reboot

    GPResult /v brings up info that it is there and present in the GPO but says : This script has not yet been run

    Any ideas on this? Help, pretty please with sugar on top.

    Tuesday, March 3, 2015 2:01 PM

Answers

  • If you need this to run on startup, you need to set it up as a scheduled task, and set your trigger for "At startup".

    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    • Proposed as answer by jrv Tuesday, March 3, 2015 2:58 PM
    • Marked as answer by Bill_StewartModerator Wednesday, March 11, 2015 1:10 AM
    Tuesday, March 3, 2015 2:04 PM
    Moderator

All replies

  • If you need this to run on startup, you need to set it up as a scheduled task, and set your trigger for "At startup".

    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

    • Proposed as answer by jrv Tuesday, March 3, 2015 2:58 PM
    • Marked as answer by Bill_StewartModerator Wednesday, March 11, 2015 1:10 AM
    Tuesday, March 3, 2015 2:04 PM
    Moderator
  • Thanks for the reply and I'm sure your answer is valid nad we may even give it a go, but why have PowerShell start up scripts as a GPO function if we have to run it as a ST?

    Tuesday, March 3, 2015 2:25 PM
  • The problem will be that GPOs are deployed from the network.  If the network is not connected then there will be no startup scripts run.

    Using scheduler will help but only after you get the system to update from a GPO the deploys the task.  I recommend fixing the problem.


    ¯\_(ツ)_/¯

    Tuesday, March 3, 2015 2:27 PM
  • Thanks for the reply and I'm sure your answer is valid nad we may even give it a go, but why have PowerShell start up scripts as a GPO function if we have to run it as a ST?

    Startup scripts are run from the network.  They are not sored on the workstation. If the network is not connected no GPOs will be run and no startup scripts.


    ¯\_(ツ)_/¯

    Tuesday, March 3, 2015 2:28 PM
  • Ah, so they're not cached locally if you run gpupdate /force it wont cache anything like the GPO's locally?

    Okay, stupid me for making a presumption. Okay so, if i set it as a scheduled task and copy the ps1 file locally it will work? How am i going to get it to run with the system account that way though? Proactivity ensues...

    The whole problem is that the netadapter seems to drop out upon reboot until it is dis/re-enabled, we have 480 of these Samsung tablets and could do with being able to image them with our new SCCM corp spec build (yeah dont ask whoever bought them before i cam along) until they release W8.1 Drivers we are a bit screwed.

    Really appreciate your help btw.

    Tuesday, March 3, 2015 2:56 PM
  • It sounds like you will need to follow mjolinor's guidance and set a scheduled task to run at startup, at least until the vendor fixes the driver problem. You should be able to run as local system.

    -- Bill Stewart [Bill_Stewart]

    Tuesday, March 3, 2015 3:21 PM
    Moderator