How can I create a windows shutdown script from powershell/command-line?

Posted by David Rubin on Server Fault See other posts from Server Fault or by David Rubin
Published on 2014-05-27T20:06:05Z Indexed on 2014/05/27 21:33 UTC
Read the original article Hit count: 298

I've read the TechNet pages that describe using computer/user startup/shutdown scripts, and that's great, but I'd like to create those scripts via the command-line (and not have to click around in gpedit.msc).

It looks like scripts.ini and psscripts.ini in %SYSTEMROOT%\System32\GroupPolicy\Machine\Scripts specifies the scripts to run, but those don't exist until running gpedit.msc for the first time. Is it safe to create and edit those directly? Or do I need to muck around with Set-GPO or something similar? Thanks!

© Server Fault or respective owner

Related posts about windows-server-2008-r2

Related posts about group-policy