Search code examples
windowsstartupgoogle-compute-enginegoogle-cloud-platform

Startup Script on Windows GCE - Where is it logged?


I'm wondering where startup script logging occurs (if it does automatically) on the MS Windows Images provided by Google for the GCE. The documentation is pretty clear about logging for the Linux images, but doesn't indicate anything for Windows.

Thanks in advance!

-Ben


Solution

  • After a practical test, here is what I can say

    -GCE stores the script in the following location

    C:\Program Files\Google\Compute Engine\sysprep\startup_script.ps1

    -The script is executed using a task in the Task Scheduler, root folder, named: GCEStartup

    -The script is passed as a command-line parameter to powershell.exe, meaning there is no automatic logging.

    Answer: You need to implement logging in your script manually. The only output is the basic Task Scheduler logs.