Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 150956

Re: Double Customization

$
0
0

Thats correct.  If you want to use Customization Script Manager, you need to do it during the deploy of the VM in the script.

 

Using Templates, Customization Manager and PowerCLI is very powerful.  With the help of other admins here on Community site, I have a truly powerful script that can create hundreds of vms (I know because I have done it) with New Names, Static IPs, Access to the domain and new SIDs.  Granted these are all Windows Servers.  Below is the base code of what you want it to look like:

 

    Get-OSCustomizationSpec "Name of Customization Script" | Get-OSCustomizationNicMapping | `

    Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress "Static IP Address X.X.X.X" `

        -SubnetMask "Subnet IP Address x.x.x.x" -DefaultGateway "Gateway IP Address x.x.x.x" -Dns "First DNS IP x.x.x.x","Second DNS IP x.x.x.x"

    New-VM -Name "VM Server Name" -Template "Template Name" -VMHost "VM Host to deploy on" `

        -Datastore "Datastore Name" -OSCustomizationSpec "Name of Customization Script" `

        -Confirm:$false -RunAsync

 

 

Best way of course would be to use variables. Below is the same code with assigned variables.  This way you get place it into a loop if you are building multiple machines.

 

Get-OSCustomizationSpec $script | Get-OSCustomizationNicMapping | `
Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress $IP `
    -SubnetMask $SM -DefaultGateway $GW -Dns $DNS1,$DNS2
New-VM -Name $Name -Template $Template -VMHost $VMHOST `
    -Datastore $Datastore -OSCustomizationSpec $script `
    -Confirm:$false -RunAsync

 

If you require to do other options on the server once Sysprep has completed, Powershell from Microsoft (which PowerCLI is written from) has a lot of options.

 

What exactly are you trying to do?

 

Thanks,

Boston Tech Guy


Viewing all articles
Browse latest Browse all 150956

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>