Home > Virtualization > Manage your VMware environment using SCVMM scripts

Manage your VMware environment using SCVMM scripts

January 22, 2010 Leave a comment Go to comments

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.

 

 

Categories: Virtualization
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: