Installing powercli.

I spoke with some people and noticed that not everyone is familiar with scripting vmware VI using powershell. I thought i would made a post with how to obtain/install what is needed to get it done.

1) Go to

2) download VMware-PowerCLI-4.1.1-332441.exe

3) Start installing powercli, you might encounter an error sayin that powershell 1.0 is not installed. In this case you will have to also download windows powershell. For XP O/S you can download using this url:

If you have other O/S please download the right version for you:

3)while installing powercli, you will be asked if installer can change for you the execution policy to “Remote Signed”. You should choose “Do this For Me”. If you click Continue, you will have to do this manually after installation. Execution policy is well described here:
You can always verify it by invoking cmd-let:
and set it by invoking
You can also read manual within powershell about ExecutionPolicy typing:
Get-Help About_Signing

4)We will need some editor for our scripts(although you can write directly under powershell.exe).

You can use editor that comes with powershell – Powershell ISE, or you can try PowerGUI from

5) I assume, that all went right, and you can start powercli console : start->programs->vmware->powercli

After powercli initializes its environment, you can test you connection to ESX/VC.

Simply type:

connect-viserver IP_ESX//IP_VC

Connect-viserver without any switches will ask you after few seconfs for credentials.

If you typed user/password without issues you will see something like this:

Name                           Port  User
—-                           —-  —-
Esx/Vc IP                 443   Logged_User

It means that you can start scripting 😉 Try some basic cmd-lets like:

get-vm / get-vmhost , try what stands behind get-cmd

That’s it for now, in next few days i will write more about powercli basics.  If you have encountered any problems, let me know.


I decided to start writing entries in english 😉

Blocking www access to ESXi 4.1

Right, so what if you have an ESXi box that is reachable from internet but you are not comfortable knowing when somebody can check your esxi webpage. What is more, he can even browse your whole DATASTORE !!!
We should block http access, but block in that way so we will be still able to connect with powershell to our esxi.
It is well documented here :
I will write shortly what is it about :
We should open our esx webpage :


and invoke method.
So our WWW service is written here under ” / ” definition.

Name Type Value
accessMode string “httpsWithRedirect”
dynamicProperty DynamicProperty[] Unset
dynamicType string Unset
port int 8309
serverNamespace string “/”

We will delete ” / ” entry in order not to display homepage / datastore browser .
So click “ha-proxy-service” , after this click RemoveEndpoint, and type :

<endpoint xsi:type="ProxyServiceEndpointSpec"> 

From now on you will see 404 😉
This idea was wrriten by William Lam and can be found here :