list of all the vm and what host they belong to

Hi, I'm new to powercli & just had a (probably really simple) question.

When I do something like:

Get-vmhost-name "hostname" | Get - vm

I get all the VMs on that host, but I only get powerstate, name, num cpu and memory. But if I again through "export-csv" pipes, I get tons more of information. How can I get this info on the command line itself, or better still to filter the columns that I want to see when the piping to the csv format?

My goal was actually to get a list of all vm AND host it that belonged to, using the command get - vm, but I couldn't very well to show me was the information I'm looking for.

Thanks in advance.

Hello, lm31-

There are several ways you could get the data properties.  You can "select" properties of the object using the Select-Object cmdlet.  So if you want to get a virtual machine and return some properties of choice, you might do something like:

PS C:\> Get-VM myVM | Select-Object Name,Folder,ProvisionedSpaceGB,NumCpu,MemoryMB

Name               : myVM
Folder             : testVMs
ProvisionedSpaceGB : 41.01
NumCpu             : 1
MemoryMB           : 2048

A simple example of something that would work for your scenario to get all virtual machines and displaying the name of the host on which they are running:

PS C:\> Get-VM | Select-Object Name,VMHost

Name          VMHost
----          ------
myVM          ourHost0
myVM1         ourHost1
...

Once you get a little more complicated reporting, you will definitely want to use the cmdlet Get-View, for reasons of speed of the script, but for this example, the foregoing will do ok.

Tags: VMware

Similar Questions

  • list of all the users and password

    Hello
    I am creating a SQL to list all users in a database with their password so I can run the result in a different database.
    I'm almost there, but I'm having problems, citing the password so I can run the result without having to edit.
    It's probably easy for you guys, but I'm completely stuck :(

    SELECT "change user" | name | "identified by the values" | password
    FROM sys.user$
    When the password is not null
    and name not in ('SYS', "SYSMAN")

    result:
    change user "user1" identified by values (not the real password string :) 9P136N0982Q2Y65T1
    I would like the following:
    change user "user1" identified by the values of "9P136N0982Q2Y65T1".
    Concerning
    933746

    SELECT "change user" | name | "identified by the values" | password
    FROM sys.user$
    When the password is not null
    and name not in ('SYS', "SYSMAN")

    Try

    SQL> SELECT 'alter user ' || name || ' identified by values ' || chr(39) ||
      2     password || chr(39)
      3  FROM sys.user$
      4  where password is not null
      5  and name not in ('SYS','SYSMAN');
    
  • List of all the roles a user belongs

    Hello
    I want to get a list of all the roles to which a user belongs with OIM 11 g APIs.
    oracle.iam.identity.usermgmt.api.UserManager
    oracle.iam.identity.rolemgmt.api.RoleManager

    A code example will be very useful.

    Thank you

    for the time being, use "*" instead of ConstantsDefinition.WILDCARD and move forward

  • What happened to the button on the address bar which allow you to see the pages you had been so that you don't have to click the back button several times? I use it all the time and it is not on FF4.

    What happened to the button on the left end of the address bar which allow you to see the pages you had been so that you don't have to click the back button several times? You can look at the drop down window of pages and just choose whatever you want. I use it all the time and it is not on FF4. I want to go back to the old FF.

    If you right click on your back button, or click and hold down the mouse button, it will display the list. (I prefer a click-right, because sometimes my fingers slide when I try to click and hold)

  • Create a script to list all the .bat and .cmd files with the dir command &

    Hello

    Im trying to create a script that will list all the .bat and .cmd files in a specific folder and add the data to a new file (file.txt) - example below:

    dir c:\>desktop\file.txt/OD
    dir d:\>>desktop\file.txt
    dir f:\jobs\*.bat>>desktop\file.txt/OD

    IM able to search the F drive and the list of all the .bat files using a generic parameter, but ideally id like to search for .bat and .cmd files, but whenever I have it try does not work. Any ideas?

    I tried the following:

    dir c:\>desktop\file.txt/OD
    dir d:\>>desktop\file.txt
    dir f:\jobs\*.bat,*.cmd>>desktop\file.txt/OD

    Any help is appreciated, the reason for which I need to check all the .bat and .cmd files is to ensure that the scripts on a cluster are all data, so need them all listed in a doc if possible

    Thank you

    Hello

    Thank you for visiting the Microsoft answers community site. Your question of Windows 7 is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for guys official script Forum. Please ask your question in the official Scripting Guys Forum.

    http://social.technet.Microsoft.com/forums/en-us/iTCG/threads

  • Script to list all the VMS and their scsi controller

    Hey guys,.

    New to scripting and my boss is looking for me to get a list of all the vm in our environment and the type of scsi controller they have. It seeks to go to paravirtual controller and need to know what vm, he needs to hit. I saw there is a script to change the paravirtual but he won't do it again, just the list including vm has what. Any help would be greatly appreciated.

    Thank you

    Rich

    Something like that?

    Get-VM | Select Name,@{N="Controller Type";E={Get-ScsiController -VM $_ | Select -ExpandProperty Type}}
    
  • Where is a list of all the updates of Coldfusion security and fixes for all versions of Coldfusion?

    Hello

    Does anyone know if there is a page that lists all the updates and security fixes for all versions of Coldfusion? I find their update/patch pages of description to be very frustrating to also manage/announce/make available their updates/corrections. I use CF9.0.2.

    Thanks in advance!

    Joe

    You can find the list here: http://helpx.adobe.com/security/products/coldfusion.html

    As a side note, my company has a service called HackMyCF that helps you stay on top of what updates to install: http://hackmycf.com/ it is a free scanner and a paid subscription that gives you more in-depth reports like this one: https://foundeo.com/hack-my-cf/example-report.cfm

  • My new system see the the old system in the network, but I can't get the passwords to work and I tried all the. Now what?

    ESTABLISHING A NETWORK.

    My new system see the the old system in the network, but I can't get the passwords to work and I tried all the. Now what?

    Hello

    1. don't you make changes on the computer before the show?
    2. what version of operating system you are using on the computer?
    3. which network you're talking about (home wireless network or group)?
    4. which steps have tried?


    If you use a group home on the computer, see the link for more information.
    Home Sweet homegroup
    http://Windows.Microsoft.com/en-us/Windows7/help/home-sweet-HomeGroup-networking-the-easy-way

    You can also check out the link.
    Microsoft's strategy concerning lost or forgotten passwords
    http://support.Microsoft.com/kb/189126

     
    Provide us more information for you to help.
  • What is an application error, wmiprvse.exe? It keeps popping up all the time and its quite annoyinng. Can I get rid of him?

    What is an application error, wmiprvse.exe? It keeps popping up all the time and its pretty boring. Can I get rid of him?

    What this has to do with Windows Media?

    Rwillet,

    Thank you for visiting the Microsoft answers community.

    The wmiprvse.exe file is otherwise known as Windows Management Instrumentation.

    In research, I found a few articles that might help you:

    Windows wmiprvse.exe related errors

    Wmiprvse - wmiprvse.exe

    You can run your scan virus and if necessary, perform a System Restore to a point prior to the error occurring.

    I hope this helps.

    Lisa
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • installation failed several times to KB2656353 and KB2656370 security update. I downloaded all the patches and recommended tools. What should I do?

    Received phone call from someone who identified himself as a member of the Technical Support of the Windows team.  Says my calculation had sent messages back saying that I had a virus.  Was skeptical and didn't know how to check if it was legitimate then toldl him I would take care of him. Ran Norton Security and Windows security and both reported that my system do not have a virus.  Noticed that Windows update was not the last 2 weeks so I tried to run the updates.  I get a sayingi error message that FAILURE of installing up-to-date security for KB2656353 and KB2656370.  I downloaded all the patches and recommended tools. What should I do?

    Have you tried the recommendations in this thread:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-windows_update/cannot-install-update-kb2656353-i-am-receiving/f3c353ca-4d85-44e6-a5f0-eb9a5330d7c8

    and this article:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-windows_update/Windows-updates-continue-to-fail-with-codes-0x66a/5e05e18e-E2E5-400e-B114-75f155571b5c

  • I installed creative cloud but it has not installed all the products and when I try to install Photoshop or Lightroom nor install it simply places another version of creative cloud.exe into my list of downloads

    I installed creative cloud but it has not installed all the products and when I try to install Photoshop or Lightroom nor install it simply places another version of creative cloud.exe into my list of downloads

    You try to install from the Web or Adobe Creative Cloud application?

    If you had installed the Adobe Creative Cloud desktop application, launch it and connect.

    Once logged in, click on the tab menu Apps.

    After loading the list of apps apps, Photoshop and Lightroom and click Install next to him.

    Location of the Adobe Creative cloud: C: > program (x 86) > Adobe > Adobe Creative Cloud > VAC > creative cloud.


    For more details, see the 2 links above mentioned in the previous post

    .



  • My Apple Macbook late 2009 has been upgraded to 4 GB and Mountain Lion but runs very slowly. When I check the memory system activity monitor, I see that there are 1.6 GB inactive. Is this the cause of the slowness and what I can do?

    My Apple Macbook late 2009 has been upgraded to 4 GB and Mountain Lion but runs very slowly. When I check the memory system activity monitor, I see that there are 1.6 GB inactive. Is this the cause of the slowness and what I can do?

    Reinstall OS X from scratch and add more RAM.

    Ways to help make a slow Mac faster

    17 reasons why your Mac runs slower than expected

    Slow performance of Mac? This Article addresses!

    Difficulty of slow start in OS X | MacFixIt - CNET Reviews

    6 easy tips to speed up OS X Yosemite on your Mac.

    Avoid using third-party software that claims to clean your computer. This software does more harm than good. In addition, you don't need it. Note that all computers become slower over time even in the normal conditions of use. Generally, the experienced users erasing the hard drive and do a clean install from scratch at least once a year or every time that the installation of a major upgrade of the OS. Well sure doing so also means that you need to maintain regular and several backups.

    Add more RAM or reduce the number of simultaneously executed from applications and utilities. Remove unnecessary software such as anti-malware and that promises to clean your Mac. Look for the runaway process: Runaway applications can shorten the battery life, affect performance and increase the heat and fan acti... See also:

    Before Mavericks

    Open the activity monitor in the Utilities folder.  Select all processes in the drop process .  Click the % CPU column heading twice to display in descending order.  If find you a process that uses a large amount of time processor (> = 70,) then select the process, and then click the quit icon in the toolbar.  Click the force quit button to kill the process.  See if that helps.  Don't forget to mention the name of the runaway process, so you can find the cause of the problem.

    Mavericks and later versions

    Open the activity monitor in the Utilities folder.  Select all processes in the menu display .  Click the CPU tab in the toolbar. Click the % CPU column heading twice to display in descending order.  If you find a process that uses a large amount of CPU %, then select the process, then click on the quit icon in the toolbar.  Click the force quit button to kill the process.  See if that helps.  Don't forget to mention the name of the runaway process, so you can find the cause of the problem.

    Things you can do to solve the slow Downs

    If your computer seems to run slower, here are some things you can do:

    Start with tours: OS X maintenance - MacAttorney;

    The X Lab: the X-frequently asked questions.

    " Safe mac" Mac Performance Guide;

    " Safe mac" the myth of the dirty Mac;

    Maintenance fast Mac Help.

    Start in Safe Mode , and then repair your hard disk and permissions:

    Fix the hard disk and permissions before Lion

    Boot from your OS X install disk. After the installer loads, choose your language and click on the button continue. When the menu bar appears select utility drive in the Utilities menu. After that the charges of THE select your entry from hard drive (mfgr. ID and car size) in the list on the left.  In the status area, you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is faulty or has failed. (State SMART is not reported on external drives Firewire or USB). If the drive is "verified", then select your OS X volume in the list on the left (subentries under the entry for the road), click the first aid tab, then click the repair disk button. If THE reports any errors that have been corrected, and then run repair disk again until no errors are reported. If no errors are reported, click repair permissions. Wait until the operation is complete, then exit FROM and return to the installer.

    Repair the hard drive - Lion-Lion/mountain/Mavericks

    HD recovery start:

    Restart the computer and after the buzzer, press on and hold down the COMMAND and R until it appears the screen of Menu utilities. Otherwise, restart the computer and after the buzzer, press on and hold down the OPTION key until the Boot Manager screen. Select recovery HD disk icon and click on the button below.

    When the recovery menu appears, select disk utility. After that the charges of THE select your entry from hard drive (mfgr. ID and car size) in the list on the left.  In the status area, you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is faulty or has failed. (State SMART is not reported on external drives Firewire or USB). If the drive is "verified", then select your OS X volume in the list on the left (subentries under the entry for the road), click the first aid tab, then click the repair disk button. If THE reports any errors that have been corrected, and then run repair disk again until no errors are reported. If no error is not reported, then click repair permissions. Wait until the operation is complete, then exit FROM and return to the main menu. Select restart from the Apple menu.

    Restart your computer normally and see if it helped at all. Then do little maintenance:

    For disk utility can't handle situations, the best third party is Disk Warriorutility;  Fixed DW only for problems with the disk directory, but most disk problems are caused by the corruption of directory; Warrior drive 4.x is now compatible with Intel Mac.

    Note: Alsoft ships DW on a bootable DVD that will boot Mac running Snow Leopard or earlier. He cannot start Mac that came with Lion or later preinstalled, however, DW will work on these models.

    Suggestions for OS X maintenance

    OS X performs certain maintenance functions that are supposed to take place on a daily, weekly, or monthly period. Maintenance scripts that are run at the beginning AM only if the computer is turned on 24/7 (no sleep). If this isn't the case, then a great solution is to download and install a shareware like Macaroni, JAW PseudoAnacronor Anacron utility that will automate the maintenance regardless of whether activity if the computer is off or asleep.  Dependence on third-party utilities to run periodic maintenance scripts has been significantly reduced since Tiger.  These utilities have little or no functionality with Snow Leopard or later version, and must not be installed.

    OS X automatically defrags files smaller than 20 MB in size, so unless you have a disk full of very large files it little need to defragment the hard drive.

    Under no circumstances should you install operating MacPaw or ZeoBit software (CleanMyMac/CleanMyDrive or Mac Keeper, respectively.) You don't need special software to keep your computer.

    Useful links about malware Protection

    "If you have an immediate problem with ads popping up see the Mac without danger" Adware removal Guide and AdwareMedic.

    Open Safari, select Preferences from the Safari menu. Click the Extensions icon in the toolbar. Disable all Extensions. If it stops your problem, then re-enable one by one until the problem returns. Now remove this extension as it is the origin of the problem.

    The following comes from user stevejobsfan0123. I made minor changes to adapt to this presentation.

    Difficulty a few pop ups browser that supported Safari

    Common pop - ups include a message saying that the Government has taken over your computer and you pay release (often called "Moneypak"), or a false message saying that your computer has been infected and you need to call a number of tech support (sometimes claiming to be Apple) to get it to be resolved. First of all, understand that these pop-ups are not caused by a virus and that your computer has not been assigned. This "hack" is limited to your web browser. Also understand that these messages are scams, so don't pay not money, call number, or provide personal information. This article will give an overview of the solution to remove the pop-up window.

    Quit Safari

    Usually, these pop-ups will not go by clicking 'OK' or 'Cancel '. In addition, several menus in the menu bar may become disabled and show in grey, including the option to leave Safari. You'll probably force quit Safari. To do this, press command + option + ESC, select Safari, press on force quit.

    Relaunch Safari

    If you restart Safari, the page will reopen. To avoid this, hold the "Shift" key when opening Safari. This will prevent windows since the last time that Safari was running since the reopening.

    It will not work in all cases. The SHIFT key must be maintained at the right time, and in some cases, even if done correctly, the window is displayed again. In these circumstances, after force quit Safari, turn off Wi - Fi or disconnect Ethernet, depending on how you connect to the Internet. Then restart Safari normally. He'll try to reload the malicious Web page, but without a connection, it will not be able to. Leave this page by entering a different URL, i.e. www.apple.com and try to load it. Now you can reconnect to the Internet and the page that you entered is displayed rather than the malicious.

    An excellent link to read is Tom Reed Mac Guide of malicious programs.

    Also, visit the FAQ XLab and read of detection and avoid malicious software and spyware.

    Check out these articles from Apple:

    Mac OS X Snow Leopard and malware detection

    OS X Lion-Protect your Mac against malicious software

    OS X Lion mountain - protect your Mac against malicious software

    OS X Mavericks-Protect your Mac against malicious software

    On the quarantine of file under OS X

    If you need antivirus protection Thomas Reed recommends to use ClamXAV. (Thanks to Thomas Reed to this recommendation.)

    The user Joe Bailey comes this equally useful advice:

    The facts are:

    1. There is no anti-malware software can detect 100% of malware out there.

    2. There is no anti-malware that can detect all targeting the Mac.

    3. the best way to prevent breaches the most is for you as the user is aware that

    the most successful malware attacks rely on sophisticated social engineering

    techniques preying on human greed, * and fear.

    4 Internet pop-up windows telling the FBI, NSA, Microsoft, your ISP has detected malware on

    your computer is designed to trick you into installing their malware thinking it's a

    protection against malware.

    5. some of the anti-malware market products are worse than malware

    go where they are supposed to protect you.

    6. be careful where you go on the internet.

    7. don't download anything from sites, you know are safe.

    8 avoid links that you receive in email, always be wary, even if you get something

    you think a friend is, but that you did not expect.

    9. If there is any question in your mind, then assume that it is malware.

    Troubleshooting Applications

    I recommend that you download a utility such as TinkerTool System, OnyX, Mavericks Cache Cleaneror hiding a Cocktail that you can use to delete the former newspapers and archives, cleaning, etc. Corrupted cache, logs or temporary files can slow down the application or OS X crashes and panics of the kernel.

    If you have leopard snow or leopard, then for similar repairs install Applejackfreeware utility.  If you do not start in OS X, you can boot into single-user mode , where you can run Applejack to make a set of routines for repair and maintenance of the command line.  Note that it takes 1.5 AppleJack for Leopard. AppleJack 1.6 is compatible with Snow Leopard. Applejack does not work with Lion and later versions.

    Basic backup

    For some people, Time Machine will be more than enough. Time Machine is part of Mac OS X. There are two components:

    1. a panel of Time Machine preferences as part of the system of preferences;

    2. a request for Time Machine, located in the Applications folder. It's

    used to manage backups and restore backups. Time Machine

    requires a backup drive that is at least twice the capacity of the

    drive being backed up.

    You can also get an external drive at least equal to the size hard disk internal and make (and maintain) a bootable clone/backup. You can make a bootable clone using the disk utility's restore option. You can also create and maintain clones with good backup software. My personal recommendations are (the order is not significant):

    1 Carbon Copy clone

    2. get backup

    3 already seen

    4 superDuper!

    5. Synk Pro

    6. Tri-Backup

    Visit The FAQ XLab and read the FAQ on the backup and restore.  Also read How to back up and restore your files. For using Time Machine, visit FAQ Time Machine of Pondini for help with all this time Machine.

    Referenced software can be found at MacUpdate .

    Additional tips

    Make sure you have a sufficient amount of RAM installed for the number of applications you run simultaneously. Make sure to leave a minimum of 10% of the capacity of the hard disk as free space.

    Add more RAM. If your computer less than 2 GB of RAM and you use OS X Leopard or later, then you can do it with more RAM. Snow Leopard and Lion works much better with 4 GB of RAM that is their system. Most concurrent applications, that you tend to use the more RAM you should have.

    Always have at least 15 GB, or 10% of the capacity of your hard disk as free space, the largest. OS X frequently accesses your hard disk, so offering enough free space will keep things slow down.

    Check for applications that may be hogging the CPU:

    Before Mavericks

    Open the activity monitor in the Utilities folder.  Select all processes in the drop process .  Click the % CPU column heading twice to display in descending order.  If find you a process that uses a large amount of time processor (> = 70,) then select the process, and then click the quit icon in the toolbar.  Click the force quit button to kill the process.  See if that helps.  Don't forget to mention the name of the runaway process, so you can find the cause of the problem.

    Mavericks and later versions

    Open the activity monitor in the Utilities folder.  Select all processes in the menu display .  Click the CPU tab in the toolbar. Click the % CPU column heading twice to display in descending order.  If find you a process that uses a large amount of time processor (> = 70,) then select the process, and then click the quit icon in the toolbar.  Click the force quit button to kill the process.  See if that helps.  Don't forget to mention the name of the runaway process, so you can find the cause of the problem.

    This problem occurs often because of a corrupted cache or the preferences file or an attempt to write in a corrupted log file.

  • Reorganize all the folders and subfolders manually, after the reboot, changes were not saved and return to the default settings

    I arranged recently manually all the folders and subfolders by list and alphabetical order, but when I turned my computer off and turn it back on, it goes back to the default settings.  I need to know what setting I need to change to avoid it too reset and also how to organize all the files and subfolders both (list and alphabetical order) because it is very long and fustrating to go into each folder and do it, can you help me with a quick and simple solution?

    * original title - arranged manually all the folders and subfolders by list and alphabetical order, but when I turned my computer off and turn it back on, it goes back to the default settings *.

    Hi Lilian13,

    You can read the following article and check if it helps:

    Organize, sort, or group your files

    http://Windows.Microsoft.com/en-us/Windows7/arrange-sort-or-group-your-files#section_1

    Hope this information is helpful

  • Don't need a list of all the recipients printed as wasting valuable resources

    Original title: print the list of safe senders

    Don't need a list of all the recipients printed as a waste of valuable resources paper and ink printing *.

    A little additional information would facilitate answering questions.

    What type of program. Print what etc.

    If you're talking about emails from Outlook.

    Export the data as a CSV file, but exclude unwanted fields, in particular the field of message body, because that would be very great.

    Import into Excel and clean the remaining fields.

  • I am unable to find all the programs and features in win7 as I want to uninstall yahoo messenger

    I am unable to find all the programs and features in win7 as I want to uninstall yahoo messenger

    That's what Yahoo have to say - http://help.yahoo.com/kb/index?y=PROD_ACCT&page=content&id=SLN408&actp=lorax&locale=en_US

    If the control panel is set to display the categories - programs - programs and features

    If the control panel is set to display the icon - programs and features.

    Yahoo Messenger should be in this list.

    If you say programs and features isn't in the Panel or Yahoo Messenger is installed, but not in the list, then something else is wrong.

    Try in "search programs and files" type "programs and features" (without the quotes). In the results list, you should see "programs and features" near or at the top of the list, click it.

    If Yahoo messenger is installed and will not uninstall, see the above link to the bottom of his page.

Maybe you are looking for