简体   繁体   中英

GPO Run powershell startup script without waiting for it

I'm trying to set a powershell startup script for the PCs in my windows domain. The script takes about 20 seconds to complete and i dont want the boot process to wait until it finishes. I set it like described in this article http://technet.microsoft.com/en-us/magazine/dd630947.aspx Additionaly i set the GPO option to run the startup scripts asynchronosly as descrbed here http://msdn.microsoft.com/en-us/library/ms811602.aspx But the boot process still takes 20 seconds longer than without the script. Any tips how to solve the issue?

The thing about startup scripts is that you can guarantee that it runs BEFORE anyone logs in, so the delay will be there. What async processing does, is enabling execution of multiple startup scripts at the same time, but all of them have to complete before you can logon.

Atm. I have two possible solutions:

  • Change the script to be a logon-script. This will pretty much just move the delay, but you could make the script run during/after the desktop is loaded.
  • Have a startup script that schedules your "real" startup-script to run ex. 1 minute after creation. at.exe / schtasks.exe would successfully create your task and you would be able to logon. Your script would then be executed after ex. 1 minute in the background.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM