mwrock / packer-templates

Templates for creating vagrant boxes
Other
536 stars 250 forks source link

administrator account is not disabled #45

Open spuder opened 8 years ago

spuder commented 8 years ago

Using this packer template, I find that the administrator account is still enabled. This is supposed to be disabled in PackerShutdown.bat when sysprep.exe /generalize is run

https://github.com/mwrock/packer-templates/blob/master/scripts/PackerShutdown.bat#L2

The shutdown command is properly configured here:

https://github.com/mwrock/packer-templates/blob/master/vbox-2012r2.json#L22

Is this right? Shouldn't it be auto logging in as 'vagrant' ? screenshot 2016-07-05 16 37 31

mwrock commented 8 years ago

I dont have access to my vbox server now. But looking at this I'm thinking that removing

                <AdministratorPassword>
                    <Value>vagrant</Value>
                    <PlainText>true</PlainText>
                </AdministratorPassword>

from the postunattend.xml may keep the administrator user disabled.

spuder commented 8 years ago

I had the same thought earlier today.

According to this link, that section might be required. I'll try it later to see what happens.

https://technet.microsoft.com/en-us/library/cc766283%28v=ws.10%29.aspx?f=255&MSPPError=-2147217396

Both Microsoft-Windows-Shell-Setup | Autologon and Microsoft-Windows-Shell-Setup | UserAccounts | AdministratorPassword sections are now needed for autologon in audit mode to work. Both of these settings should be added to the auditSystem pass.

spuder commented 8 years ago

Negative, without the admin password set, windows prompts for the admin password on first boot.

screenshot 2016-07-12 17 27 52
dragon788 commented 8 years ago

@spuder Is there a "disabled: true" option we could set in that section? Or a "hidden: true" option for the Administrator account specifically?

spuder commented 8 years ago

I haven't found much on google. Perhaps something like this

net user administrator /active:no

http://www.acumenitsupport.com/windows/unattend-xml-to-sysprep-your-image-and-not-disable-local-administrator