VMware Cloud Community
Stephanevg
Contributor
Contributor
Jump to solution

DeleteAccounts in CustomizationSpecs

Hi guys,

I am trying to understand what the property "DeleteAccounts" in a OSCustomizationSpecs really does?

This is my case that raises my question:

I do have a Windows 2012R2 template that I use to provision VM's using PowerCLI.

I keep bumping into the case, that the OsCustomization deletes the account I have, and creates a new one. The issue I have with that, is that I have a startup script in the Start Menu/startup folder which is then deleted.

I tried without the ChangeSID parameter, but according to this article, ChangeSID is actually a mandatory parameter for all Windows Server machines.

i was hoping that "DeleteAccounts" set to $false would not delete the existing accounts (thus, my administrator account),but apparently this is not the case. (Even though $false is the default value).

My main question is the following:

  1. Since it deletes my administrator account, can anyone tell me what it actually "doesn't" delete? or is this a 'feature'?

Thanks in advance!

Stéphane

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

The deleteAccounts is ignored since API 2.5, see CustomizationWinOptions

That option is not deleteing your local accounts.

The ChangeSid option is always selected since Vista.

If the creation of the local accounts is not part of your unattended.xml, they will not be there after the SysPrep.
You should create the accounts and the customisation of the system through the unattended.xml or the custoisation spec (via the Run part, where you can run scripts.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

The deleteAccounts is ignored since API 2.5, see CustomizationWinOptions

That option is not deleteing your local accounts.

The ChangeSid option is always selected since Vista.

If the creation of the local accounts is not part of your unattended.xml, they will not be there after the SysPrep.
You should create the accounts and the customisation of the system through the unattended.xml or the custoisation spec (via the Run part, where you can run scripts.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Stephanevg
Contributor
Contributor
Jump to solution

I didn't know that it was deprecated. Thanks for pointing this out @LucD!

Just for the record: I simply googled VMware.Vim.CustomizationSpecItem and navigated through the different links until I arrived here --> https://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.vm.customization.WinOptions.html  There is no mention that it is deprecated. Maybe this doc should be updated, or rerouted.

In my case, the template is as it is, and I cannot modify it. I can only clone it, and add modifications to the cloned VM.

What do you exactly mean with the runpart? The guirunonce?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

That is a doc for VI 3, we're on 6.5 currently.
And I don't think they will update that document.

Yes, the GuiRunOnce allows to run commands.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos