I have become a big fan of the Virtual Infrastructure (VI) Toolkit over the last month and it has really helped me learn PowerShell which I knew I would have to learn sooner or later but kept putting off.
I would now like to spread the word and help out those of you wondering what the hype is all about by telling you how to get started.
Do I need to install the VI toolkit on the VI server ?
No, Definitely not, this can be installed on your workstation and can be used to hook into the Virtual Infrastructure, nothing additional will need to be loaded onto the VI server.
What you will need
Download the following and install them in order:
- .Net framework 2.0 (if not already installed)
This is a Next, Next jobbie until completed.
- PowerShell for Windows (For XP/Vista/2003 you will need to download this but for 2008 this will come pre-installed.) http://www.microsoft.com/windowsserver2003/technologies/management/powershell/download.mspx
This is also a Next, Next jobbie until completed.
- VI Toolkit for Windows 1.0 http://www.vmware.com/sdk/vitk_win/index.html
Just to make a change this is a Next Next
That gets the basics but what you also may want to install is the following:
- PowerGUI, This is a GUI for PowerShell which makes editing scripts 10 times easier http://powergui.org/ (you can also use Admin script editor if you prefer http://www.adminscripteditor.com/)
- Download ActiveRoles Management Shell for Active Directory, The ActiveRoles Management Shell for Active Directory is a set of predefined commands for PowerShell. These commands are designed to help administrators automate common, repetitive and bulk management tasks such as creating, removing or updating objects in Active Directory. http://www.quest.com/powershell/activeroles-server.aspx
- VMware PowerPack, add this to PowerGUI to help you step through the VI toolkit without learning PowerShell http://powergui.org/entry!default.jspa?categoryID=21&externalID=1802
Once these have all been installed you are nearly ready.
From your desktop start the VI toolkit via the newly created shortcut or choose it from the Start Menu if you prefer, once started type the following and press enter:
Set-ExecutionPolicy RemoteSigned
You are now all set to start with PowerShell and the VI toolkit, lets do a simple task just to get you started…
From within the Powershell window now open connect to your Virtual Infrastructure server by using the following command or as you are now using powershell they are know as cmdlets.
Connect-VIServer YourServername
Obviously replace YourServerName with you VI Server. Once connected you will be able to start issuing commands to the session to retrieve information, try the following simple cmdlet and press enter:
Get-VM
You will now see a list of all Virtual Machines.
And so it begins, this is just a simple cmdlet which will get you hooked from the start, issue the following command to list the other VI Toolkit cmdlets:
Get-VICommand
This should list enough for you to get started, now you can explore PowerShell and the VI Toolkit, for quick examples of what can be done take a look at the VMware examples here:
Managing VMware with PowerShell FAQ
Now there will be no looking back, welcome to the Jedi !
None of this works. Can we get an updated ‘Getting started’ page for 2015?
Great blog. I have started learning Powecli scripting from this website.
The link for VI toolkit for windows needs to be updated.
Here is the new one http://blogs.vmware.com/vipowershell/2009/01/vi-toolkit-15-released.html
Pingback: PowerCLI – Where do I start ?! « Virtu-Al
Thanks