Datasheet
CREATE AN AUTOMATED INSTALLATION 7
Install, Con gure, and
Manage the vSphere
Environment
PART I
$DrvPath = “C:\WINDOWS\system32\sqlncli10.dll”
New-Regkey “HKLM:SOFTWARE\ODBC\ODBC.INI\$ODBCName” `
“Driver” $DrvPath
New-RegKey “HKLM:SOFTWARE\ODBC\ODBC.INI\$ODBCName” `
“Description” $ODBCName
New-RegKey “HKLM:SOFTWARE\ODBC\ODBC.INI\$ODBCName” `
“Server” $DBSrv
New-RegKey “HKLM:SOFTWARE\ODBC\ODBC.INI\$ODBCName” `
“LastUser” $DBUser
New-RegKey “HKLM:SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources” `
$ODBCName “SQL Server Native Client 10.0”
# Install vCenter
Write-Host “Installing vCenter”
$exe = “$VCmedia\vpx\VMware-vcserver.exe”
$args = ‘/q /s /w /L1033 /v” /qr USERNAME=\”$($username)\” ‘
$args = $agrs + `
‘COMPANYNAME=\”$($Companyname)\” LICENSEKEY=\”$($LIKey)\” ‘
$args = $args + `
‘DB_SERVER_TYPE=Custom DB_DSN=\”$($ODBCName)\” ‘
$args = $args + `
‘DB_USERNAME=\”$($DBUser)\” DB_PASSWORD=\”$($DBPass)\” ‘
$args = $args + ‘REBOOT=SUPPRESS’
Start-process $exe $args -Wait
# Initiate the Database Tables
Write-Host “DB tables”
$Exec = “$ENV:PROGRAMFILES\VMware\Infrastructure\VirtualCenter
Server\vpxd.exe”
Start-Process $Exec “-b” -Wait
Start-Service vpxd
Additional components, such as the vCenter Client or Update Manager, can easily
be added to the previous script. Simply add a few extra lines in the install script,
much like the vCenter Client install code that follows:
# Install vCenter Client
Write-Host “Installing vCenter Client”
Invoke-Item “$VCMedia\vpx\VMware-viclient.exe /s /w /v /qn `
/L*v %TEMP%\vmvcc.log `
WARNING_LEVEL=0”
890790c01.indd 7890790c01.indd 7 3/3/11 10:22:15 AM3/3/11 10:22:15 AM