New-OSCustomizationSpec

This cmdlet creates a new OS customization specification or clones an existing one. If a name is provided, creates and adds the specified customization specification to the server. Otherwise, creates and returns the requested specification object. If the Name parameter is not specified, the OSCustomizationSpec object is not persisted on the server. Either the Domain or the Workgroup parameters should be provided if a Windows specification is created. If a Linux specification is created, the Domain parameter is mandatory. New-OSCustomizationSpec automatically creates a default NIC mapping.

Syntax

[-Description  <String>]
[-DnsServer  <String[]>]
[-DnsSuffix  <String[]>]
[-Domain  <String>]
[-Name  <String>]
[-NamingPrefix  <String>]
[-NamingScheme  <String>]
[-OSType  <String>]
[-Server  <VIServer[]>]
[-Type  <OSCustomizationSpecType>]
[CommonParameters]

Parameters

Required Parameter Name Type Position Features Description
optional
Description
String named Provides a description for the new specification.
optional
DnsServer
String[] named Specifies the DNS server settings. This parameter applies only to Linux operating systems.
optional
DnsSuffix
String[] named Specifies the DNS suffix settings. This parameter applies only to Linux operating systems.
optional
Domain
String named Specifies a domain name.
optional
Name
String named Specifies a name for the new specification.
optional
NamingPrefix
String named Depends on the customization naming scheme - Custom, NamingPrefix, or Prefix. If the "Custom" naming scheme is used, NamingPrefix is an optional argument that is passed to the utility for this IP address. The meaning of this field is user-defined in the script. If the "Fixed" naming scheme is used, NamingPrefix should indicate the name of the virtual machine. If the "Prefix" naming scheme is selected, NamingPrefix indicates the prefix to which a unique number is appended.
optional
NamingScheme
String named Specifies the naming scheme for the virtual machine. The following values are valid:
optional
OSType
String named Specifies the type of the operating system. The valid values are Linux and Windows.
optional
Server
VIServer[] named
  • wildcards
  • pipeline
  • Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
    optional
    Type
    OSCustomizationSpecType named Specifies the type of the OS customization specification. The valid values are Persistent and NonPersistent.

    -OSCustomizationSpec  <OSCustomizationSpec>
    [-Name  <String>]
    [-Server  <VIServer[]>]
    [-Type  <OSCustomizationSpecType>]
    [CommonParameters]

    Parameters

    Required Parameter Name Type Position Features Description
    required
    OSCustomizationSpec
    OSCustomizationSpec named
  • wildcards
  • pipeline
  • Specifies an OS customization specification that you want to clone.
    optional
    Name
    String named Specifies a name for the new specification.
    optional
    Server
    VIServer[] named
  • wildcards
  • pipeline
  • Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
    optional
    Type
    OSCustomizationSpecType named Specifies the type of the OS customization specification. The valid values are Persistent and NonPersistent.

    -FullName  <String>
    -OrgName  <String>
    [-AdminPassword  <String>]
    [-AutoLogonCount  <Int32>]
    [-ChangeSid]
    [-DeleteAccounts]
    [-Description  <String>]
    [-DnsServer  <String[]>]
    [-DnsSuffix  <String[]>]
    [-Domain  <String>]
    [-DomainCredentials  <PSCredential>]
    [-DomainPassword  <String>]
    [-DomainUsername  <String>]
    [-GuiRunOnce  <String[]>]
    [-LicenseMaxConnections  <Int32>]
    [-LicenseMode  <LicenseMode>]
    [-Name  <String>]
    [-NamingPrefix  <String>]
    [-NamingScheme  <String>]
    [-OSType  <String>]
    [-ProductKey  <String>]
    [-Server  <VIServer[]>]
    [-TimeZone  <String>]
    [-Type  <OSCustomizationSpecType>]
    [-Workgroup  <String>]
    [CommonParameters]

    Parameters

    Required Parameter Name Type Position Features Description
    required
    FullName
    String named Specifies the administrator's full name. This parameter applies only to Windows operating systems.
    required
    OrgName
    String named Specifies the name of the organization to which the administrator belongs.
    optional
    AdminPassword
    String named Specifies a new OS administrator's password. This parameter applies only to Windows operating systems.
    optional
    AutoLogonCount
    Int32 named Specifies the number of times the virtual machine automatically logs in as administrator without prompting for user credentials. The valid values are in the range between 0 and Int32.MaxValue. Specifying 0 disables auto log-on. This parameter applies only to Windows operating systems.
    optional
    ChangeSid
    SwitchParameter named Indicates that the customization should modify the system security identifier (SID). This parameter applies only to Windows operating systems.
    optional
    DeleteAccounts
    SwitchParameter named Indicates that you want to delete all user accounts. This parameter applies only to Windows operating systems.
    optional
    Description
    String named Provides a description for the new specification.
    optional
    DnsServer
    String[] named Specifies the DNS server settings. This parameter applies only to Linux operating systems.
    optional
    DnsSuffix
    String[] named Specifies the DNS suffix settings. This parameter applies only to Linux operating systems.
    optional
    Domain
    String named Specifies a domain name.
    optional
    DomainCredentials
    PSCredential named Specifies the credentials you want to use for domain authentication. This parameter applies only to Windows operating systems.
    optional
    DomainPassword
    String named Specifies the password you want to use for domain authentication. This parameter applies only to Windows operating systems.
    optional
    DomainUsername
    String named Specifies the user name you want to use for domain authentication. This parameter applies only to Windows operating systems.
    optional
    GuiRunOnce
    String[] named Specifies a list of commands. These commands run when a user logs in for the first time after the customization completes. This parameter applies only to Windows operating systems.
    optional
    LicenseMaxConnections
    Int32 named Specifies the maximum connections for server license mode. Use this parameter only if the LicenseMode parameter is set to Perserver. This parameter applies only to Windows operating systems.
    optional
    LicenseMode
    LicenseMode named Specifies the license mode of the Windows 2000/2003 guest operating system. The valid values are Perseat, Perserver, and Notspecified. If Perserver is set, use the LicenseMaxConnection parameter to define the maximum number of connections. This parameter applies only to Windows operating systems.
    optional
    Name
    String named Specifies a name for the new specification.
    optional
    NamingPrefix
    String named Depends on the customization naming scheme - Custom, NamingPrefix, or Prefix. If the "Custom" naming scheme is used, NamingPrefix is an optional argument that is passed to the utility for this IP address. The meaning of this field is user-defined in the script. If the "Fixed" naming scheme is used, NamingPrefix should indicate the name of the virtual machine. If the "Prefix" naming scheme is selected, NamingPrefix indicates the prefix to which a unique number is appended.
    optional
    NamingScheme
    String named Specifies the naming scheme for the virtual machine. The following values are valid:
    optional
    OSType
    String named Specifies the type of the operating system. The valid values are Linux and Windows.
    optional
    ProductKey
    String named Specifies the MS product key. If the guest OS version is earlier than Vista, this parameter is required in order to make the customization unattended. For Vista or later, the OS customization is unattended no matter if the ProductKey parameter is set.
    optional
    Server
    VIServer[] named
  • wildcards
  • pipeline
  • Specifies the vCenter Server systems on which you want to run the cmdlet. If no value is provided or $null value is passed to this parameter, the command runs on the default servers. For more information about default servers, see the description of Connect-VIServer.
    optional
    TimeZone
    String named
  • wildcards
  • Specifies the name or ID of the time zone for a Windows guest OS only. Using wildcards is supported. The following time zones are available:
    optional
    Type
    OSCustomizationSpecType named Specifies the type of the OS customization specification. The valid values are Persistent and NonPersistent.
    optional
    Workgroup
    String named Specifies a workgroup. This parameter applies only to Windows operating systems.

    Output

    VMware.VimAutomation.ViCore.Types.V1.OSCustomization.OSCustomizationSpec

    Examples


    Example 1

    New-OSCustomizationSpec -Name Spec -OSType Windows -FullName Administrator -OrgName Organization -NamingScheme Fixed -NamingPrefix Computer -ProductKey "xxxx-xxxx" -LicenseMode PerSeat -Workgroup Workgroup -ChangeSid

    Generates a new SID for the machine and sets the name of the machine to "Computer".

    Example 2

    New-OSCustomizationSpec -Name Spec -OSType Windows -Description "This spec adds a computer in a domain." -FullName Administrator -OrgName Organization -NamingScheme Fixed -NamingPrefix "Computer" -ProductKey "xxxx-xxxx" -LicenseMode Perserver -LicenseMaxConnections 30 -AdminPassword pass -Domain Domain -DomainUsername Root -DomainPassword pass

    Creates a customization specification that adds a computer in the domain named "Domain".

    Related Commands

    Feedback

    Was this page helpful?