Set PowerShell script or batch file to run before user logs into Windows 10 computer

Is it possible to set a PowerShell script or batch file to run before a user logs into a Windows 10 computer that is a member of a Server 2016 Active Directory domain?

If so how can this be done?
IT GuyNetwork EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

footechCommented:
You can set a computer startup script to run via Group Policy.  This will run before any user logs on.

A user logon script will run at the time of logon.  If you need the script to run in the context of the user logging in, you can't have it run before that user logs in because it has no idea what user will be logging in, and has no access to the session, user permissions, etc.
0
IT GuyNetwork EngineerAuthor Commented:
Can someone please provide me with the exact steps on how to set a computer startup script to run via Group Policy that will run before any user logs on?
0
Shaun VermaakTechnical Specialist/DeveloperCommented:
Wrong image, should be a network path or relative path to GPO
startup-script-3-e1427833355513-1-.png
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
McKnifeCommented:
But keep in mind that startup scripts will only run after restarts and not after shutdown - restart. That is due to thefeature "fast startup" that win8 and win10 are using. If unclear what I am talking about: https://www.experts-exchange.com/articles/25279/Overcoming-software-deployment-pitfalls-on-modern-Windows.html has all the theory and all the steps to overcome this limitation. The systems will detect policy changes and disable fast startup if configured using the steps in that article.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.