Manage your VMware environment using SCVMM scripts
Do you know that you can create scripts using cmdlets that are provided with SCVMM 2008 to manage your VMware environment ?
For example, you can use the Add-VirtualizationManager cmdlet to add a VirtualCenter Server.
# Description: Adds a VMware VirtualCenter Server to VMM.
# Connect to the VMM server.
Get-VMMServer -ComputerName "VMMServer1.Contoso.com"
# Define the variables.
$AddCredential = Get-Credential
$Cert= Get-Certificate -Computername "VirtMgrServer01.Contoso.com"
# Require user to accept the certificate before adding the VirtualCenter Server.
Write-Host "Following is the certificate information for this VirtualCenter Server:"
$Cert
$AcceptCert = Read-Host "Do you accept this certificate? If you accept, enter Y."
If ($AcceptCert -eq "Y")
{
# Add the Virtual Center Server.
Add-VirtualizationManager -ComputerName "VirtMgrServer01.Contoso.com" -Certificate $Cert –TCPPort 443 -Credential $AddCredential -SecureMode $TRUE
}
Else
{
Write-Host "The script cannot continue unless the certificate is verified. Ending script."
}
After you add the VirtualCenter Server, you can manage the VMware ESX Server hosts.