Archive for March 2013

Install and Configure Update Manager PowerShell Library

index

Update Manager PowerShell Library

VMware Update Manager – PowerShell Library may be installed and used on any machine that has VMware Infrastructure Toolkit (for Windows) installed and access to a VirtualCenter server. It does not require to be installed on the same machine as the VMware Update Manager or the VirtualCenter Server.

You can install Update Manager – PowerShell Library the following ways

  • A stand-alone Windows installer
  • As a part of the installation process of the VMware Update Manager (Update Manager server or Update Manager plug-in)

Prerequisites

To install and use Update Manager – PowerShell Library 1.0 , you need to have installed the following:

  • .NET 2.0 SP1
  • Windows PowerShell 1.0
  • VI Toolkit (for Windows) 1.5 Download Here
  • Update Manager – PowerShell Library 1.0 works only with Update Manager 1.0 Update

Installing Update Manager – PowerShell Library Using the Stand-Alone
Installer

  • Install the VI Toolkit for Windows 1.5
  • Click on the exe. Click Next

tool1

  • Accept License Agreement

tool2

  • Select Destination folder and click Next

tool3

  • Create Desktop Shortcut if required

tool4

  • Click Install and say yes to the below message

tool5

  • Click Finish and Launch VMware VI Toolkit

tool6

Installing Update Manager – PowerShell Library Using Update Manager Installer

The VMware Update Manager (Server or User Interface Plugin) installer provides an option to install Update Manager – PowerShell Library if you already have VI Toolkit (for Windows) installed on the target system.
To install the VMware Update Manager – PowerShell Library as part of the VMware Update Manager (Update Manager Server or Update Manager plugin) installation

  • Launch the VMware Update Manager installer and follow the wizard instructions.
  • In the VMware Update Manager Toolkit page, select the Install VMware Update Manager Toolkit check box.
  • Proceed with the VMware Update Manager installation.

Getting Started with Update Manager – PowerShell Library

The VMware Update Manager – PowerShell Library provides a set of 13 cmdlets for downloading software updates, creating baselines, and for scanning and remediating virtual machines or hosts. These cmdlets are stored in the VMware.VUMAutomation plug-in, and are available through the VI Toolkit (for Windows) console.

  • To get started with Update Manager – PowerShell Library, launch the VI Toolkit (for Windows) console from the Windows Start menu or by clicking the VI Toolkit shortcut icon.
  • To get a list of all Update Manager – PowerShell Library cmdlets, run the Get-Command with the -PSSnapin parameter:

POWERCLI

Install and Configure vSphere PowerCLI

index

What is vSphere PowerCLI?

vSphere PowerCLI provides easy-to-use C# and PowerShell interface to VMware vSphere APIs. It ships with a number of cmdlets that you can use to perform various administration tasks on VMware vSphere components

Installation Pre-Requisites

  • .NET 2.0 SP1
  • Windows PowerShell 1.0/2.0/3.0

Supported Operating Systems
VMware vSphere PowerCLI 5.0 is supported on the 32-bit and 64-bit versions of the following Windows operating systems:

  • Windows 7
  • Windows Server 2008
  • Windows Vista
  • Windows XP Service Pack 2
  • Windows 2003 Server Service Pack 2

Supported VMware Environments

vSphere PowerCLI 5.0 is compatible with the following VMware environments:

  • VMware ESXi 5.0
  • vCenter Server 5.0
  • VMware ESX 4.1/vCenter Server 4.1
  • VMware ESXi 4.1
  • VMware ESX 4.0 Update 2/vCenter Server 4.0 Update 2
  • VMware ESX 4.0 Update 1/vCenter Server 4.0 Update 1
  • VMware ESX 4.0i Update 1
  • VMware ESX 3.5 Update 5
  • VMware ESXi 3.5 Update 5
  • VMware VirtualCenter 2.5 Update 6
  • VMware ESX 3.0.3 Update 1

Identify Cmdlet Concepts

PowerShell cmdlets use a consistent verb-noun structure, where the verb specifies the action and the noun specifies the object to operate on. PowerShell cmdlets follow consistent naming patterns, which makes it easy to figure out how to construct a command if you know the object you want to work with.
All command categories take parameters and arguments. A parameter starts with a hyphen and is used to control the behavior of the command. An argument is a data value consumed by the command.

PowerShell

 PowerCLI Components

To use these snap-ins, you must add them using the add-pssnapin cmdlet.

Example

  • add-pssnapin vmware.vimautomation.core

power

Installing

  • Download PowerCLI from the VMware website
  • Click the exe and install
  • You may get a message such as below

Power2

  • And this message – Click Continue

power3

  • Click Next

power4

  • Click Next

power5

  • Click Next

power7

  • Keep the default selection

power8

  • Click Install

power9

Configuring PowerCLI

Set the properties for Remote Signing

For security reasons, Windows PowerShell supports an execution policy feature. It determines whether scripts are allowed to run and whether they must be digitally signed. By default, the execution policy is set to Restricted, which is the most secure policy. If you want to run scripts or load configuration files, you can change the execution policy by using the Set-ExecutionPolicy cmdlet. For more information about the execution policy and script digital signing in Windows PowerShell, run Get-Help About_Signing.

  • Right click on the PowerCLI icon and selecy Run as Administrator
  • Type Set-ExecutionPolicy RemoteSigned

power10

Slow Startup

I experienced a really slow start-up from PowerCLI. It had something to do with internet access and checking the certificates. I disabled this by doing the below

  • Open the Control Panel → Go To Internet Options → Go to the Advanced tab → Go to the Security Section
  • Un-check the “Check for publisher’s certificate revocation” check-box

TIP

Certificate Errors

Certificate error can generally be ignored but if you want to make sure they don’t come up try typing the following

  • Set-PowerCLIConfiguration -invalidCertificateAction ignore -confirm:$false

power11

Guides

vSphere PowerCLI User Guide

PowerCLI cmdlet Reference

PowerShell Community

http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli