LordofVxRail
Enthusiast
Enthusiast

Disable Guest OS Customization

Jump to solution

hello all, I was hoping someone may be able to help with my query.

I need to Disable Guest OS Customization on a VM that I import to vApp via powercli.

the template VM I am adding to the vApp is a Domain Controller, so I don't want any form of Sysprep.

 

this is as far as I can get:

view ExtensionData

 

 

 

PS C:\Users\Administrator> (get-civm -name 001_dc01_107732495).ExtensionData


NeedsCustomization      : True
NestedHypervisorEnabled : False
VdcComputePolicy        : VMware.VimAutomation.Cloud.Views.Reference
StorageProfile          : VMware.VimAutomation.Cloud.Views.Reference
VmCapabilities          : VMware.VimAutomation.Cloud.Views.VmCapabilities
Media                   :
VAppScopedLocalId       : da46be08-f71d-46ef-bd4d-3f25639a53dd
Environment             :
Deployed                : False
DateCreated             : 6/1/2021 12:36:26 PM
VAppParent              :
Section                 : {, 102, VMware.VimAutomation.Cloud.Views.NetworkConnectionSection, …}
Status                  : 8
Files                   :
Name                    : 001_dc01_107732495
Tasks                   :
Description             :
Id                      : urn:vcloud:vm:3864fe61-4da1-44e3-8a5f-19ad1a05a2d6
OperationKey            :
Client                  : VMware.VimAutomation.Cloud.Views.CloudClient
Href                    : https://x.x.x.x/api/vApp/vm-3864fe61-4da1-44e3-8a5f-19ad1a05a2d6
Type                    : application/vnd.vmware.vcloud.vm+xml
Link                    : {, , , …}
AnyAttr                 :
VCloudExtension         :

 

 

 

 

View ExtensionData.Section

 

 

 

PS C:\Users\Administrator> $gc = (get-civm -name '001_dc01_107732495').ExtensionData.Section | Where { $_.Type -eq 'application/vnd.vmware.vcloud.guestCustomizationSection+xml' }
PS C:\Users\Administrator> $gc


Href                  : https://x.x.x.x/api/vApp/vm-3864fe61-4da1-44e3-8a5f-19ad1a05a2d6/guestCustomizationSection/
Type                  : application/vnd.vmware.vcloud.guestCustomizationSection+xml
CustomizationScript   :
AdminAutoLogonCount   : 0
UseOrgSettings        : False
AdminPasswordAuto     : True
DomainName            :
AdminAutoLogonEnabled : False
AdminPasswordEnabled  : False
Enabled               : True
Any                   :
VirtualMachineId      : 3864fe61-4da1-44e3-8a5f-19ad1a05a2d6
ChangeSid             : False
DomainUserPassword    :
JoinDomainEnabled     : False
MachineObjectOU       :
ComputerName          : GoldDCJune2-001
DomainUserName        :
Link                  : {, , }
ResetPasswordRequired : False
AdminPassword         :
Required              : False
AnyAttr               :
Info                  : VMware.VimAutomation.Cloud.Views.OvfMsg
Client                : VMware.VimAutomation.Cloud.Views.CloudClient
VCloudExtension       :

 

 

 

 

I believe 'Enabled' field = Enable guest customization in UI, here I attempt to set it to false:

 

 

 

PS C:\Users\Administrator> $gc.Enabled = 'False'
PS C:\Users\Administrator> $gc.UpdateServerData()
PS C:\Users\Administrator> $gc


Href                  : https://x.x.x.x/api/vApp/vm-a28cdbc6-8619-419a-8a24-b6496221eaf6/guestCustomizationSection/
Type                  : application/vnd.vmware.vcloud.guestCustomizationSection+xml
CustomizationScript   :
AdminAutoLogonCount   : 0
UseOrgSettings        : False
AdminPasswordAuto     : True
DomainName            :
AdminAutoLogonEnabled : False
AdminPasswordEnabled  : False
Enabled               : True
Any                   :
VirtualMachineId      : a28cdbc6-8619-419a-8a24-b6496221eaf6
ChangeSid             : False
DomainUserPassword    :
JoinDomainEnabled     : False
MachineObjectOU       :
ComputerName          : GoldDCJune2-001
DomainUserName        :
Link                  : {, , }
ResetPasswordRequired : False
AdminPassword         :
Required              : False
AnyAttr               :
Info                  : VMware.VimAutomation.Cloud.Views.OvfMsg
Client                : VMware.VimAutomation.Cloud.Views.CloudClient
VCloudExtension       :

 

 

 

 

However, the value remain "True"

 

any idea what I am doing wrong, or another way to do it?

LordofVxRail_0-1622555274656.png

 

0 Kudos
1 Solution

Accepted Solutions
Growlert
Contributor
Contributor

Since it's a boolean parameter you should use $False instead of 'False'.

View solution in original post

0 Kudos
1 Reply
Growlert
Contributor
Contributor

Since it's a boolean parameter you should use $False instead of 'False'.

0 Kudos