VMware Cloud Community
scottg69
Contributor
Contributor

vmware-vim-cmd to powershell

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

0 Kudos
5 Replies
LucD
Leadership
Leadership

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.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
scottg69
Contributor
Contributor

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

0 Kudos
lamw
Community Manager
Community Manager

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".

LucD
Leadership
Leadership

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 Smiley Wink

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.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

scottg69
Contributor
Contributor

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

0 Kudos