StefanScherer / packer-windows

Windows Templates for Packer: Windows 11, Windows 10, Windows Server 2022, 2019, 2016, also with Docker
MIT License
1.29k stars 434 forks source link

Help with updates for my packer repo #31

Closed TraGicCode closed 7 years ago

TraGicCode commented 7 years ago

I have been struggling with this for a couple days now so i thought i would reach out to you. When i run your packer template and utilize the win-updates.ps1 script i notice that upon mandatory reboots the powershell prompt that gets loaded between reboots for performing updates is started as admin. I started my own packer templates repo and i have a different behavior. When the initial updates happen they are run in a prompt as admin but upon mandatory update reboots the shell gets open as a non-admin user and i get alot of access-denied errors for the rest of the update script. I have pin-pointed this to something in the autounattend.xml but i have no idea after looking over it multiple times on what in your autounattend.xml vs mine is causing the powershell prompt for windows updates to be open as admin. Any help is greatly appreciated.

Here is my autounattend.xml https://github.com/TraGicCode/packer-windows-playground/blob/master/answer_files/2016/autounattend.xml

TraGicCode commented 7 years ago

FIgured it out was missing the following `

false
</settings>
<cpi:offlineImage cpi:source="wim:c:/wim/install.wim#Windows Server 2012 R2 SERVERSTANDARD" xmlns:cpi="urn:schemas-microsoft-com:cpi" />`