none
Do PowerShell Startup Scripts Have to be Stored Locally or can They be Run Across the Network?

    Question

  • Hi All,

    Do PowerShell Startup scripts have to be stored locally or can they be run across the Network?

    Answers to my previous questions have made me ask this. I have been told they have to be on the local machine in a specific directory for a GPO to Run them on Startup.

    Hopefully someone can clarify?!

    Thanks in advance.

    Ben
    Saturday, January 07, 2017 4:28 PM

Answers

  • Hi
     
    Am 07.01.2017 um 17:28 schrieb Benny9997:
    > Do PowerShell Startup scripts have to be stored locally or can they
    > be run across the Network?
     
    No.
     
    > [...] I have been told they have to be on the local machine in a
    > specific directory for a GPO to Run them on Startup.
     
    If you would define them as a startup script within a LOCAL GPO,they
    would be stored by default in
    %systemroot%\System32\GroupPolicy\Machine\Scripts\Startup or .\Shutdown
     
    Inside the domain, replace %systemroot%\System32\GroupPolicy with your
    SYSVOL\Policides\{gui of gpo} as the default path, but they are allowed
    to be store in NETLOGON aswell.
     
    Beside of that, you can run a "cmd.exe /c powershell.exe
    \\somepath\script.ps1" aswell or "cmd.exe /c powershell.exe
    c:\scripts\script.ps1"
     Mark
    --
    Mark Heitbrink - MVP Group Policy - Cloud and Datacenter Management
     
    Homepage:  http://www.gruppenrichtlinien.de - deutsch
     
    • Marked as answer by Benny9997 Saturday, January 07, 2017 4:43 PM
    Saturday, January 07, 2017 4:41 PM
  • Am 07.01.2017 um 17:41 schrieb Mark Heitbrink [MVP]:
    > Am 07.01.2017 um 17:28 schrieb Benny9997:
    >> Do PowerShell Startup scripts have to be stored locally or can
    >> they be run across the Network?
    > No.
     
    No: They do not need to be stored locally.
    Yes: They can run across the network.
     
    > %systemroot%\System32\GroupPolicy\Machine\Scripts\Startup or
    > .\Shutdown
     
    or ..\User\Login or \Logoff
     
    I think now it´s complete :-)
     
    --
    Mark Heitbrink - MVP Group Policy - Cloud and Datacenter Management
     
    Homepage:  http://www.gruppenrichtlinien.de - deutsch
     
    • Marked as answer by Benny9997 Saturday, January 07, 2017 10:15 PM
    Saturday, January 07, 2017 5:17 PM

All replies

  • Hi
     
    Am 07.01.2017 um 17:28 schrieb Benny9997:
    > Do PowerShell Startup scripts have to be stored locally or can they
    > be run across the Network?
     
    No.
     
    > [...] I have been told they have to be on the local machine in a
    > specific directory for a GPO to Run them on Startup.
     
    If you would define them as a startup script within a LOCAL GPO,they
    would be stored by default in
    %systemroot%\System32\GroupPolicy\Machine\Scripts\Startup or .\Shutdown
     
    Inside the domain, replace %systemroot%\System32\GroupPolicy with your
    SYSVOL\Policides\{gui of gpo} as the default path, but they are allowed
    to be store in NETLOGON aswell.
     
    Beside of that, you can run a "cmd.exe /c powershell.exe
    \\somepath\script.ps1" aswell or "cmd.exe /c powershell.exe
    c:\scripts\script.ps1"
     Mark
    --
    Mark Heitbrink - MVP Group Policy - Cloud and Datacenter Management
     
    Homepage:  http://www.gruppenrichtlinien.de - deutsch
     
    • Marked as answer by Benny9997 Saturday, January 07, 2017 4:43 PM
    Saturday, January 07, 2017 4:41 PM
  • Thank you for the fast response!

    Ben

    Saturday, January 07, 2017 4:43 PM
  • Am 07.01.2017 um 17:41 schrieb Mark Heitbrink [MVP]:
    > Am 07.01.2017 um 17:28 schrieb Benny9997:
    >> Do PowerShell Startup scripts have to be stored locally or can
    >> they be run across the Network?
    > No.
     
    No: They do not need to be stored locally.
    Yes: They can run across the network.
     
    > %systemroot%\System32\GroupPolicy\Machine\Scripts\Startup or
    > .\Shutdown
     
    or ..\User\Login or \Logoff
     
    I think now it´s complete :-)
     
    --
    Mark Heitbrink - MVP Group Policy - Cloud and Datacenter Management
     
    Homepage:  http://www.gruppenrichtlinien.de - deutsch
     
    • Marked as answer by Benny9997 Saturday, January 07, 2017 10:15 PM
    Saturday, January 07, 2017 5:17 PM