AddVirtualCenterServer.ps1

Applies To: Virtual Machine Manager 2008, Virtual Machine Manager 2008 R2, Virtual Machine Manager 2008 R2 SP1

The following script adds a VMware VirtualCenter Server to System Center Virtual Machine Manager (VMM) in secure mode.

Disclaimer

# Filename:      AddVirtualCenterServer.ps1
# 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."
}

See Also

Concepts

AddESXHost.ps1