PowerCLI

 View Only
  • 1.  vmware-vim-cmd to powershell

    Posted Jan 04, 2010 02:10 PM

    Hi all, I am pretty new to powershell and was looking for some advice. To audit the config of our current ESX hosts we use vmware-vim-cmd commands to get the info we require. I would like to move this to powershell if possible, so suppose I have a couple questions around this:

    1.) Is it possible to get ALL the same info from powershell that is available from vmware-vim-cmd commands?

    2.) If so is there any good reference material or hints and tips to allow me to understand how I would convert my vmware-vim-cmd commands to powershell?

    Thanks in advance.

    S69



  • 2.  RE: vmware-vim-cmd to powershell

    Posted Jan 04, 2010 02:21 PM

    I can't confirm that you get everything that vmware-vim-cmd will give you since I don't know that command/script that good and it can produce an impressive amount of data (like PowerCLI can).

    Are there any specific areas you are looking at ?

    And btw, if PowerCLI doesn't have a "canned" solution, it's rather easy to fall back on the SDK methods and properties.



  • 3.  RE: vmware-vim-cmd to powershell

    Posted Jan 04, 2010 02:31 PM

    Hi LucD, I am looking to output as much of the config as possible. A useful start would be similar to the output of the vmware-vim-cmd /hostsvc/hostconfig comand. If there was a similar in powershell that would be a great starter for 10.

    Thanks for your time.

    S69



  • 4.  RE: vmware-vim-cmd to powershell

    Broadcom Employee
    Posted Jan 04, 2010 02:56 PM

    vmware-vim-cmd /hostsvc/hostconfig most likely represents the following in vSphere API: HostConfigInfo. Majority if not all the available information of vimsh is using what's available in the API and there's always a chance that some of the information maybe using some internal APIs, but from what I've seen, you can easily map what's in output back to the API

    =========================================================================

    William Lam

    VMware vExpert 2009

    VMware ESX/ESXi scripts and resources at:

    Twitter: @lamw

    VMware Code Central - Scripts/Sample code for Developers and Administrators

    VMware Developer Comuunity

    If you find this information useful, please award points for "correct" or "helpful".



  • 5.  RE: vmware-vim-cmd to powershell

    Posted Jan 04, 2010 02:59 PM

    Afaik there is no PowerCLI cmdlet that gives you this raw dump of configuration data.

    But as I said you can always fall back on the SDK to go that extra mile :smileywink:

    Have for example a look at TA2650 scripts – Part 1 – Profiling your vSphere environment, a script where I show how to dump all Config properties to an XML file.



  • 6.  RE: vmware-vim-cmd to powershell

    Posted Jan 04, 2010 05:25 PM

    Magic, that will help me loads, from the output of this I should be able to figure out all the proporties I need.

    Thanks

    S69