Folder is a virtual computer in the use of Get-View

All, I run a script to collect information on the virtual machines in the environment, but have not been able to figure out how to get the file to in the virtual machine is.  I know I could use a get - vm | Select name, file etc. but at the time wherever I have add a get - vm statement, I'll add a TON of execution time of the script.

I currently use it as my get-views command...

Notice-EEG - ViewType VirtualMachine-Name property, Runtime.Host, Config.GuestFullName, Config.Annotation, Config.Hardware.NumCPU, Config.Hardware.MemoryMB, Guest.Disk, Config.Template, Guest.IpAddress | Sort-Object-property name. %{
If ($_.) Config.Template - not $true) {}
$row = "" | Select-Object Name, Notes, MemoryGB, host, CPU, OS, Cluster, IPAddress, DiskSpaceGB, UsedSpaceGB

....

I know I'm just grabbing some properties, but I was not able to find the property that gives the name of the folder.

To try to find the right one, I did

$vm = get-View - ViewType VirtualMachine-filter @{"Name" ="VM_Name"}

Then just walk through the $vm variable. (Property) etc.

Anyone?

In the VirtualMachine object, the Parent property contains the MoRef (pointer) to the object of the file.

In order to

Select Name,@{N="Folder; E = {Get-view $_.} Parent | Select name - ExpandProperty}}

Tags: VMware

Similar Questions

  • The use of Get - view instead of Get - VM for the advanced settings of a virtual computer

    I have a question in relation to the advanced settings of a virtual machine and using Get - view instead of Get - VM for this particular case:

    Get - VM * | Get-AdvancedSetting - name "scsi * sharing | Select the entity, Name, Value

    My idea is to use:

    Notice-EEG - ViewType VirtualMachine. Where {-not $_.} Config.Template} | Where {$_.} {Advanced.Setting - eq ' scsi * sharing "} | Select the entity, Name, Value

    but as far as I can see there is nothing for the advanced configuration of 'VirtualMachine' here: https://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.powercli.cmdletref.doc%2FVirtualMachine.htm

    I also took a quick glance at https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.vm.ConfigSpec.html , but I can't figure out how to use "extraConfig"in the script PowerCLI to extract this particular information for "Sharing of SCSI".»

    There is information how to use the API to add or change a computer virtual here .vmx file key advances: http://blogs.vmware.com/PowerCLI/2008/09/changing-vmx-fi.html but it is not clear to me how to use it just to extract information without changing what.

    Try like this

    foreach ($vm in (Get-View - ViewType VirtualMachine - property Name, Config.ExtraConfig - filter @{'Config.Template ' =' False'})) {}

    $vm. Config.ExtraConfig | where {$_.} Key - like "{scsi * sharing '} |"

    Select @{N = "VM"; E = {$vm. Name}},@{N='Template'; E = {$vm. Config.Template}}, Key, Value

    }

  • Determine the maximum use of the processor for a virtual computer in the custom user interface

    I want to determine the maximum use of the processor for a virtual computer in the custom user interface.  How can I do this?

    If I use a supermetric, there is no kind of attribute under CPU called "maximum use.

    Certainly, you get points for a long question! Although to be fair, it's probably my fault to feed you so much information to digest at once.

    1. I would say you can do two ways visually. Use the operations > detail view for 'normal ranges' use the upper limit of the normal range as your typical max. You want an absolute peak, add the metric of a graph or observe that highlight high and low watermarks.

    2. There are a lot of ways to display data, but if you want to display a single metric over a period of time, we could use the following widgets [on top of my head]:

    Top - N analysis

    Weather map

    Analysis of distribution of data

    Among these, I think of your desire for a "peak". Who you want real value, which eliminates the weather map. Then, I think that the concept of a 'Summit' and what is the best thing, I think that the 95th percentile... then I came with the widget of data distribution. The decision is ultimately yours given your particular use case.

    3. you can have it apply to several virtual machines - it's just a widget capable of being an independent provider or receiving widget (metrics, DO NOT choose to select resources). Each resource/metric will add to the widget and you can remove them if you like after it is added. You can certainly all the time you visit... It is date and time standard options you have in all the other widgets chart. With the widget data distribution, you want as much time as possible to get an accurate histogram of the cycles of workload.

    4. This is similar to the question above. You can certainly add parameters of individual resource or a DM that summarizes or AVG groups of resources. And as above, the delay is configurable, along with the other graph widgets.

    5. it's part of Q4 - you can sumN or avgN up to any number of resources with a SM, then discovers that SM in the widget of data distribution. When I said container, I mean an application, group resource pool... all that acts as a container parent within the vCOps.

    6. that's correct, SMs calc using data collected last points... aka single period of time. When you are referring to the longest period, I gave you a few examples of the attributes that are composed of several periods of time which are calculated and created by the adapter for VMware vCenter behvaior. In this case, you have the GVA 15 min CPU 1.5; These specific simple mobile GVA can be specific OR a copy using SMs. Next, you will have the chance is to find a way to distribute what you need through a widget [at that time].

    7. the distribution of data is not for export, it is for Visual functions. If you want the data in CSV, just use a typical chart of metrics and export to a csv and calc your own pics, avg, 95th, whatever.

    8. This is a bit of a mix of all your questions, put in place.

    You are right, if you added those 3 VMs, then calc was the 95th of the AVG. Like Q7, you would not export the data of the distribution of data because the raw data points are not - you do not pass the metric to a metric graphics standard and export via csv.

    Take advantage of...

  • access denied to win xp computer teacher trying to access a shared folder on Windows 7 computer at home using a peer-to-peer network

    access denied to win xp computer teacher trying to access a shared folder on Windows 7 computer at home using a peer-to-peer network.  I enabled netbios over tcp/ip on computers

    Hello

    Try the steps listed in the link and check if this may help: "Access denied" error message when you try to open a file: http://support.microsoft.com/kb/810881

  • Is it possible for HA / VMotion to migrate a virtual computer when the fiber of SAN connectivity is lost / Cup?

    Use: Version ESX 4 / vCenter4

    I have a cluster with ESX 4 nodes running HA. I want to know if it is possible for vmotion to migrate a virtual computer if the host on which it lives has a loss of fiber optic connectivity to SAN/back-end storage. I can get VMotion to work when I go unplug the Ethernet cable to the back of the esx host, but when I unplug the fiber connections that will freeze the virtual machine and no migration will happen. Is it possible to do this with VMotion HA? I also tried to use aggressive DRS to see if when I unplug the fiber it lose connectivity and a loss of memory or cpu and migrate... so not happened... the vm always reports to vCenter that memory and cpu have not changed... then DRS don't not kick to migrate the virtual machine.

    Thank you.

    There is no such thing for HA. HA only fires when there is a host or a network isolation fails. DRS also does not realize this. However, there are a lot of events that can trigger an action such as "maintenance mode". don't know if there is a for the failures of way, just check it out. It is described in the following pdf document: http://www.vmware.com/pdf/vsphere4/r40_u1/vsp_40_u1_admin_guide.pdf

    Duncan

    VMware communities user moderator | VCP | VCDX

    -

  • Impossible to connect the computer to the internet after getting a virus

    Firewall settings

    I can't connect the computer to the internet after getting the following error message after I have used AVG 2011 to isolate and virus and rebooted my computer.
    Windows cannot connect to the internet using HTTP, HTTPS or FTP.  This is probably caused by the settings of firewall on this computer.
    Check the settings of firewall for the HTTP port (80) and HTTPS port (443) FTP port (21).

    I can't connect the computer to the internet after getting the following error message after I have used AVG 2011 to isolate and virus and rebooted my computer.
    Windows cannot connect to the internet using HTTP, HTTPS or FTP.  This is probably caused by the settings of firewall on this computer.
    Check the settings of firewall for the HTTP port (80) and HTTPS port (443) FTP port (21).

    Which firewall do you use? First, click on start > run > type inetcpl.cpl > Ok. Now, click on the "Advanced" tab On the Advanced tab, you should see a button to "restore the settings advanced". Click on the button. Follow the prompts all to confirm your selection. Then click on the 'Connections' tab > LAN Settings button. Make sure that there is a check mark in the box "Auto-Detection" parameters and that there is NOT a check mark in the box use proxy settings. Try to connect to the internet. Post your results please.

  • I am trying to load Windows Vista on my computer and the installation, I get an error message saying I have to close the installation program and select programs and uninstall Windows PowerShell

    I am trying to load Windows Vista on my computer and the installation, I get an error message saying I have to close the installation program and select programs and uninstall Windows PowerShell, I have no idea where I can find, I need answers, thanks in advance

    original title: where to find WIndows Poweershell?

    Go to programs and features, select view installed updates. You should find an entry for Powershell. Select it and uninstall.

  • Recovery of a virtual computer from the data after removing inventory store

    Hello

    I am new to VMware, so I apologize if this is a stupid question.

    I am running ESXi 3.5.0 and to manage the server using Vsphere Client 4.0. I tried to move a virtual machine from a to another data store, and by playing, I decided to try 'remove inventory' on the virtual machine, I was trying to move. Given the files of all the VM are still in the data store, I thought that it should not be difficult to re - add to the inventory. However, I can't figure out how to do this. Any help would be appreciated.

    In the second part of the question, why past a VM to a local data store on the server to another local data store on the same server seem to be so difficult as well? I think that I finally understand how using the VMware Vcenter Converter Standalone to clone the virtual machine for the 2nd data store, and then I guess I'll remove the original after the clone is done? This is the right way to do it, or there at - it an easier way?

    It seems to me all these things are basic operations that should be fairly straightforward to achieve, because it is expected to just move the files from one disk to another, but they are revealed to be a real pain in the butt. Am I missing something?

    Thanks in advance!

    1. In the Client, select your ESX Server host computer.

    2. Click the summary tab.

    3. Look for the icon of the data store, inside the resources box.

    4. Right-click on the data store, and then select Browse the data store.

    5. Browse the directory for your virtual machine structure.

    6. When you find the folder where your VMis, locate the file with a .vmx extension.

    7. Right click on this file and select Add to the inventory.

    Rick Blythe

    Social media specialist

    VMware Inc.

    http://Twitter.com/vmwarecares

    http://Twitter.com/vmwarekb

  • NET application SAN LUN connection for a virtual computer on the network

    Hi guys

    I have a LUN of SAN NetApp ready for a virtual computer that is connected to the network.

    How can I make the virtual machine network?

    I created another vNic and added to it as a secondary virtual machine network, but is there a better way to do this?

    Should I be using the VMKernel network and choose iScsi?

    Thanks, Julien

    Hi Julien,

    Introduce the network of the virtual machine as if it were any other network. No need to have a vmkernel, unless you want to create an iSCSI data store.

    Set up your network inside the virtual machine with an IP address in the same subnet as your storage space. Try to ping of your storage space for the guest. Configure your iSCSI initiator and present your logic unit number on the virtual computer in your NetApp.

    Concerning

    Franck

  • Through host SCSI tape drive to the virtual computer with the backup software installed in the comments

    Can I attach an external SCSI tape drive to one of my hosts, and then add it as a device in a virtual machine.

    I want to use backup exec on a virtual machine, rather than having to have a separate physical server to attach the tape drive. I realize that I wouln't be able to vmotion the guest but as its only going to be a backup machine I am happy with that.

    Thanks in advance,

    Yes is possible.

    I have a Dell TL2000 with a dedicated SAS card and it works (not faster than in a real environment, but works).

    You add the SCSI ID of the tape (and the library, if any) to the virtual machine.

    Or, if your hardware can he take charge, using VMDirectPath and give the card on the virtual computer.

    André

  • No network on the virtual machine after the use of converter

    I was running a basic vm (WinXP) on an esxi4.1 host running short of disk space.

    So I ran the vCenter Converter Standalone client to copy the original VM on a new - the only thing that I changed the size of the disc thin provisioned avaiable.   The copy/convert seemed to work your.

    I started in the new virtual machine, and it came exactly as the old one (with the largest disk).

    ... but the network on the works of more than vm.

    I can still use vSphere to connect to the esxi server and bring up the VM console (which tells me that the network the server works very well).  When I look at the configuration of the virtual machine, it looks exactly like the old (complete with a network powered).   But on the virtual machine, I can't even ping the router, much less get to the dhcp server.

    I even went so far as to stop the virtual machine, remove the network card, restart the virtual machine (if the network has been removed from the virtual machine), stop the virtual machine again, add a NEW network adapter.

    Still the problem remains.  The virtual machine has a network card - but has no network.

    A few thoughts:

    You use a managed physical switch? If so, check if the MAC address of the VM is seen on one of the uplink ports.

    The network management and the virtual machine using the same IP subnet? You could probably try (if possible) is to create an another vSwitch and attach the XP VM to it to see if there is a problem with the virtual machine and the management on the same vSwitch network.

    André

  • Rename a virtual computer in the data store

    We have an active VM (let's call it VMabcd) and it has exactly the same thing in the data store associated with her... labeled VMDK and VMX files also named VMabcd.   We would like to change the name.   I know that I can rename a virtual computer in vCenter directory but I can also do it in the data store?  What of its vmdk and vmx files?

    to do this if you have vCenter, the simplest method is to make a Storage vMotion of the guest in question.  This will rename all that behind that same as the vCenter object files.  Or you can turn off the virtual machine and making a cold migration to a new data store.

  • How to pass the virtual computer for the upgrade of the hard drive?

    I installed ESXi on a server with only 80 GB installed hard drive (RAID-1). Now, I'll upgrade the two 1 TB drives (RAID-1). What is the best possible method to back up my VM?

    I have a standby server. Installed ESXi on it and transferred a VM using VMware Converter for this spare server. After upgrading the hard disk and reinstall ESXi I want to transfer my VM to the server of origin.

    Is this the right way or is there an easier way?

    Thank you

    Chantal

    Hello

    I don't see a problem in you turn the VM on the server as well spare, you can very well do it and use it until your main server is up and Runnin'. Once the primary server running stops the virtual machine on the spare part and then copy.

    Thank you

    Samir

    PS: If you think the answer is useful please consider rewarding points.

  • limit the use of client view

    Dear all,

    Can I limit see customer use?

    for example, I can disconnect the user after reaching limited hours.

    Best regards

    Dennis Dai

    There is a time-out value of session under configuration and global settings of the admin page.  You can also try to use a GPO to disconnect users after a specified period of time.   The only problem is that they could turn around and connect immediately after disconnection.

    If you have found this device or any other useful post please consider the use of buttons useful/correct to award points

  • problem in the use of named view search criteria form

    Hello

    You will need to create a search form using criteria from view.


    I have a table named question (issueid, loggedby) and a main table named login (u_id, passwd, u_name).
    There is a b & w u_id and loggedby reference field (means that when I create a new problem, the loggedby field is filled with u_id).
    Now, I want to create a search form that display the table according to supplied u_name which is available in the connection.


    run time search for user to the question as

    loggedby = 'mohan '.

    but the issue table store u_id on loggedby user field mohan (do not store the name).

    Thanks in advance

    You can join your table user (on the user name) in the table and have the name and the id in the VO...

    select issue.*, login.* from issue join login on issue.iloggedby=login.u_id;
    

    Noah your VO contains the name and u_id.

    Timo

Maybe you are looking for