none
W10 PS (local) startup script only running when connected to the network

    Question

  • Pretty much as above; I have a ps script saved locally which I tell GP to run as a startup script. It runs fine when I'm connected to our network but it doesn't run at all if I'm not (for testing, the first thing the script is supposed to do is write to a local log file). This is a bit annoying because I want to use it to set what shell to run depending on whether a laptop is connected to our network or not!

    I only need this running on Windows 10. I have a sneaky suspicion that it's something to do with powershell execution policies but I use group policy to set it as 'Allow All Scripts' and when I check in PS the execution policy says unrestricted.

    Anyone any ideas?!

    Wednesday, March 08, 2017 11:24 AM

All replies

  • Hi,
    Please check what settings is configured for Always wait for the network at computer startup and logon policy setting under Computer Configuration\Administrative Templates\System\Logon.
    Best regards,
    Wendy

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, March 09, 2017 5:34 AM
    Moderator
  • Hi Wendy

    We have that enabled. I've not come across this problem before, only in W10.

    thanks

    Thursday, March 09, 2017 10:22 AM
  • Hi,
    Please try it again by disabling that policy, and see if it works.
    In addition, you could have a try to use a scheduled task for running script and see if same behavior happens again.
    Here is a similar thread which you could refer to:
    https://www.experts-exchange.com/questions/28303316/Logon-Script-won%27t-run-if-network-isn%27t-available.html
    Please Note: Since the web sites are not hosted by Microsoft, the links may change without notice. Microsoft does not guarantee the accuracy of this information.
    Best regards,
    Wendy

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, March 13, 2017 2:21 AM
    Moderator
  • Hi,

    I am checking how the issue is going, if you still have any questions, please feel free to contact us.

    And if the replies as above are helpful, we would appreciate you to mark them as answers, and if you resolve it using your own solution, please share your experience and solution here. It will be greatly helpful to others who have the same question.

    Appreciate for your feedback.

    Best regards,

    Wendy


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, March 17, 2017 9:42 AM
    Moderator
  • Sorry, your suggestion didn't work. Does anyone have a good feel for why this seems to be different in Windows 10?

    Thanks

    Friday, March 17, 2017 9:52 AM
  • Hi,
    So, have you tested the same configuration on windows 10 and other windows clients system, like windows 7, 8…? And does the problem only happen on windows 10?
    If that is the case, I would suggest you post the question in the windows 10 forum to see if ant different configuration is changed on client:
    https://social.technet.microsoft.com/Forums/en-US/home?category=Windows10ITPro
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Best regards,
    Wendy

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Tuesday, March 21, 2017 2:45 AM
    Moderator