Update custom fields in VC without using Get - VM

Greetings-

I am trying to determine a way to update a custom field in Virtual Center via powershell without using Get - VM.  I am able to extract custom using Get-View fields

$VMView = Get-View -ViewType virtualmachine -filter @{"Name" = $input_machinename}

return $VMview.customvalue [7] .value

However, all of the examples I found related to the update/filling of custom fields requires the use of Get - VM.  While that's great and all, but everyone knows at this stage that Get - VM is something you want to avoid problems with speed

http://communities.VMware.com/thread/206909;JSESSIONID=C3AC43115524E4F5F8608530367321B3?TSTART=0

http://communities.VMware.com/message/1122166#1122166

It is an example of the code snippet that I fight with in an attempt to update a custom field.

#This is the line which takes about 2 minutes

$VMName = Get-VM | {$_.name - eq "adv0010vpvc01"}

$VMView = $VMName | Get-View

$VMName.CustomFields.values [3] # prints the name of custom field

$VMName.CustomFields.keys [3] # print the value of custom field

$VMView.setCustomValue($VMName.CustomFields.keys[3],"10/10/2000") #Updates custom the field with the value "10/10/2000.

Thank you very much

The final alternative is to use the SDK method to set a custom field.

Can you try this and see if it is faster?

$input_machinename = 
$CustomVarName = 
$CustomVarValue = 

$vm = Get-View -ViewType virtualmachine -Filter @{"Name"=$input_machinename}
$vm.setCustomValue($CustomVarName, $CustomVarValue)

Tags: VMware

Similar Questions

  • update of the input xml without using the table

    Hello

    I am new to oracle xml I entered below.this came from front end.

    < employees >

    < employee >

    < > 7369 empno < / empno >

    < ename > SMITH < / ename >

    < deptno > 20 < / deptno >

    < sal > 1000 < / sal >

    < job > CLERK < / job >

    < / employee >

    < employee >

    < > 7499 empno < / empno >

    < ename > ALLEN < / ename >

    < deptno > 30 < / deptno >

    < sal > 1000 < / sal >

    < job > SELLER < / job >

    < / employee >

    < employee >

    < > 7521 empno < / empno >

    < ename > WARD < / ename >

    < deptno > 30 < / deptno >

    < sal > 1000 < / sal >

    < job > SELLER < / job >

    < / employee >

    < employee >

    < > 7566 empno < / empno >

    < ename > JONES < / ename >

    < deptno > 20 < / deptno >

    < sal > 1000 < / sal >

    < job > MANAGER < / job >

    < / employee >

    < employee >

    < > 7654 empno < / empno >

    < ename > MARTIN < / ename >

    < deptno > 30 < / deptno >

    < sal > 1000 < / sal >

    < job > SELLER < / job >

    < / employee >

    < employee >

    < > 7698 empno < / empno >

    < ename > BLAKE < / ename >

    < deptno > 30 < / deptno >

    < sal > 1000 < / sal >

    < job > MANAGER < / job >

    < / employee >

    < employee >

    < > 7782 empno < / empno >

    < ename > CLARK < / ename >

    < deptno > 10 < / deptno >

    < sal > 1000 < / sal >

    < job > MANAGER < / job >

    < / employee >

    < employee >

    < > 7788 empno < / empno >

    < ename > SCOTT < / ename >

    < deptno > 20 < / deptno >

    < sal > 1000 < / sal >

    < job > ANALYST < / job >

    < / employee >

    < employee >

    < > 7839 empno < / empno >

    < ename > KING < / ename >

    < deptno > 10 < / deptno >

    < sal > 1000 < / sal >

    < job > PRESIDENT < / job >

    < / employee >

    < employee >

    < > 7844 empno < / empno >

    < ename > TURNER < / ename >

    < deptno > 30 < / deptno >

    < sal > 1000 < / sal >

    < job > SELLER < / job >

    < / employee >

    < employee >

    < > 7876 empno < / empno >

    < ename > ADAMS < / ename >

    < deptno > 20 < / deptno >

    < sal > 1000 < / sal >

    < job > CLERK < / job >

    < / employee >

    < employee >

    < > 7900 empno < / empno >

    < ename > JAMES < / ename >

    < deptno > 30 < / deptno >

    < sal > 1000 < / sal >

    < job > CLERK < / job >

    < / employee >

    < employee >

    < > 7902 empno < / empno >

    < ename > FORD < / ename >

    < deptno > 20 < / deptno >

    < sal > 1000 < / sal >

    < job > ANALYST < / job >

    < / employee >

    < employee >

    < > 7934 empno < / empno >

    < ename > MILLER < / ename >

    < deptno > 10 < / deptno >

    < sal > 1000 < / sal >

    < job > CLERK < / job >

    < / employee >

    < / employees >

    In I want to update only the sal smith to 999. is it possible in sql and plsql.

    Note:-l' entry above is from front end only no table.

    Please help in this.

    Thank you

    SQL > DECLARE

    2

    3 xmldoc xmltype: = xmltype)

    4'

    5

    6 7369

    7 SMITH

    8        20

    9 1000

    10 REGISTRAR

    11

    12

    13 7499

    14 ALLEN

    15        30

    16 1000

    17 SELLER

    18

    19 ');

    20

    BEGIN 21

    22

    23 select xmlquery)

    24 ' copy $d: =.

    25 edit)

    26 replace the value of the node $d/employees/employee [empno = $empno] / sal

    27 with $new_sal

    28              )

    29 return $from

    30 passage xmldoc

    31, 7369 as 'empno '.

    32, 999 as 'new_sal '.

    33 contents of return

    34           )

    35 in xmldoc

    36 double;

    37

    38 dbms_output.put_line(xmldoc.extract('/').getclobval);

    39

    END 40;

    41.

    7369

    SMITH

    20

    999

    CLERK

    7499

    ALLEN

    30

    1000

    SELLER

    PL/SQL procedure successfully completed

  • after update of cc, I can't use photoshop cs6 without logging in cc.  Is there a way to get around this?

    after update of cc, I can't use photoshop cs6 without logging in cc.  Is there a way to get around this?

    I do nothing stored on the cloud, all work is local and I do not have to be connected.  It also seems to make Photoshop a LOT slower.

    Hello Christy,

    If it's a standalone Photoshop CS6 (ie you have a serial key) there is no need to connect to the desktop creative cloud application.

    If you have downloaded the 'previous Versions' CS6 creative cloud desktop application so you will need to stay connected on the creative cloud desktop application.

    Concerning

    Bianka Attre

  • Focus / Unfocus spoils the fields when using custom fields - help

    Hello

    I hope someone can help me with a problem I see with a screen that contains a VerticalScreenManager that contains a number of custom HorizontalFieldManagers, which each contain a LabelField and an EditField.

    Note: I use a HorizontalFieldManager customer so that I can use sublayout to field possible as I need.

    The purpose of the screen is to allow the user to scroll through the fields and on the focus on the areas of editing.

    However, as the user rolls and fields in bulk and get focus, 'development emphasizing' is not 'cleaned' of previous field and so he is spoiling: several fields have the "update highlighting.

    I saw several other similar topics in the forum but nothing quite the same thing.

    Screen

    -Vertical area Manager (standard)

    -(Custom) HorizontalFieldManager - LabelField - EditField

    -(Custom) HorizontalFieldManager - LabelField - EditField

    -(Custom) HorizontalFieldManager - LabelField - EditField

    It seems that when the scrolling HorizontalFieldManager becomes and lose focus, but do not repaint itself? Is this possible?

    I use OS 5.0.

    Thank you very much

    David

    It seems that the problem was the VerticalFieldManager had not the color of the sae background as areas that are part of it and so when the focus and unfocus painted the background color VerticalFieldManager was painted, I don't know why this has been, and if it's a bug in the OS 5.0, but when I set the background color in the VerticalFieldManager I don't see the problem.

  • How to identify the siebel custom index created from DB without using siebel tools

    Dear Experts,

    Please let us know how to identify siebel custom indexes that are created directly through DB. We don't are not sure on the customer tables had created indexes.

    Thank you

    Carine Ch

    Hello carine,.

    Thank you for using Oracle communities.

    Custom indexes created without using Siebel tools are not included in the schema definition in the Siebel Repository.

    Just for your information, these indexes are deleted during the upgrade of database. In order to preserve these indexes, add them to the repository Siebel using Siebel Tools.

    Now come to your query you have utility DBCHCK.

    DBCHCK is that Siebel provided utility to compare the logical schema in the Siebel Repository against objects in the physical Oracle database.

    DBCHCK must be run regularly to check the status of the Siebel business, especially after a release.

    DBCHCK can be useful to identify custom index added by the development team, but not added to the repository using Siebel tools.

    You can run it from a server in the environment. A performance by connection to the base. This should be run from the folder siebsrvr

    You can get more information from document following knowledge.

    How the Dictutl and the dbchck to run? (Doc ID 475677.1)

    I hope it helps.

    Best regards

    Chetan

    P.S. If one of the answers was correct or useful, it would be great if you can mark as appropriate help the other identified correctly updated.

  • I bought a Macbook used, and now I can't update iMovie, iPhoto and iTunes without apple ID of the older owner how can I work around this?

    Hey everybody,

    This is my first post. A couple of years, I bought a used Macbook. I never did update (it is so long and then I decide to Watch youtube videos... it is not used for work or school). So now, I've updated the Yosemite and I want to get everything updated and it requires that I put a password of the former owner apple ID to update iTunes, iPhoto and iMovie. How can I get around this without reformatting and losing thousands of photos and all my files.

    Thank you guys.

    If you are the legal owner of the computer, but if the software you want is owned by another user is not yours. You cannot add any other purchases to your ID. You own, or that they are.

    backup with time machine

    move all your data in the folder user to an external drive or a flash drive is formatted in a format not mac or by checking the box "ignore this volume permissions" in get info of this device.

    do a clean install of the operating system

    create a new administrative account

    the Time Machine restore requests

    transfer your data from external sites back to the new account.

  • Re: How to get Corel WinDVD without using the recovery disk?

    The update for Corel WinDVD was rather messy and because of this some owners laptop uninstalled to try to install the new software. Now, we ended up with the only possibility of an image recovery, which, in practice, means losing the software.

    Updates for the Bluetooth and wifi are also pretty messy.
    Is isn´t possible to get this software back without using the recovery disk?

    As you probably know recovery image installed on Toshiba laptops is a kind of software that includes the operating system, drivers, tools specific to Toshiba and utilities but also some additional software like antivirus or DVD player application.

    All drivers and Toshiba tools and utilities are available on the Toshiba download page, and if you want to install the version of the OS, you can download each of them.
    This additional software is not available for download. It's a kind of gift on the owner of the laptop because as the new owner, your machine must be ready to employment with full protection and opportunities to use multimedia content.

    If you don't like it, you can remove the system and use your own applications.

    Summary: this software cannot be downloaded separately and if you want to have it again, you must install original image of recovery designed for your machine.

    If you have any other questions do not hesitate to ask.

  • Given that I have updated to IOS 9.2 my Ipad 2 Air is discharge the battery in 12 to 14 hours, even without any use. Before the update, after a day of average use of the battery was still 70-75%. How can I reinstall the IO 9.1?

    Given that I have updated to IOS 9.2 my Ipad 2 Air is discharge the battery in 12 to 14 hours, even without any use. Before the update, after a day of average use of the battery was still 70-75%. How can I reinstall the IO 9.1?

    Hello

    The best way to save battery life is to go into the settings and turn off Apps Refresh

    I now get 3 / 4 hours of battery life more.

    You cannot return to a previous ios 9.1

    See you soon

    Brian

    PS

    If you still have a problem iCloud backup now

    Then restore settings to get rid of any bugs.

  • Need help with Custom Field Layout - getting wirer height value

    In the BB Simulator, I get a strange value placed in in my field layout() method custom. The width is 320, which is correct, but the height is 1073741823 and it takes 240 or less. In this test, my custom field is the only field in the Manager, so I expect to 240.

    I tried two different simulators - BB curve and the 8800. I use JDE 4.5.0 in Eclipse 3.4.1. This is the code for my method of layout:

    Protected Sub layout (int width, int height) {}
    s long = getStyle().
    If ((s & USE_ALL_WIDTH)! = USE_ALL_WIDTH) {}
    width = Math.min (width, getPreferredWidth());
    }
    If ((s & USE_ALL_HEIGHT)! = USE_ALL_HEIGHT) {}
    height = Math.min (height, getPreferredHeight());
    }
    setExtent (width, height);
    model.setExtent (width, height);
    Model.Scroll (0, 0);
    }

    I expect the value of the screen height, or less, if the domain is configured correctly.

    I'm upgrading my custom field in a VerticalField Manager with the following attributes:

    Super (VerticalFieldManager.USE_ALL_WIDTH
    | VerticalFieldManager.USE_ALL_HEIGHT
    | VerticalFieldManager.FIELD_HCENTER | VerticalFieldManager.FIELD_VCENTER);

    Is this a bug in the Simulator, or I understand the API correctly? Is there a way to 'reset' the Simulator - I tried to get out of Eclipse and restart Windows, but I always get the same value.

    Thank you!

    Mark

    A VerticalFieldManager comes, I think, with default VERTICAL_SCROLL.  If you do not want to scroll through this particular Manager, add VerticalFieldManager.NO_VERTICAL_SCROLL to your forests of style and it will be laid out with only the height and the actual width.

    Also, since you setExtent() by yourself, USE_ALL_HEIGHT and USE_ALL_WIDTH are redundant, I think.

    Hope that helps,

    Arkady.

  • Get-TagAssignment entity includes the names of custom field (Bug?)

    Our environment uses several annotations on the VMS CustomAttribute. I noticed that when I use Get-TagAssignment on the virtual machines in our vCenter, the entity object, which should be only an object VM (VirtualMachineImpl), has a name that includes all the majority of the CustomAttribute annotation names. This happens regardless of whether I do anything regarding CustomAttributes or not. I tested on multiple vCenters and multi-instance PowerCLI (all 6.0R3) on different computers with similar behavior. I tried to search and I couldn't find any reference to a bug anywhere.

    Also strange that some of the VMS seem to have the name of the computer virtual appears first, then the different names of CustomAttribute. Other virtual machines, seem however to enumerate CustomAttribute appoints first as well as the name of the virtual machine in the end. No apparent reason for the difference.

    This looks like a bug, but I want to confirm whether there is something unusual about my environment or if others are able to replicate this.

    Steps to reproduce (assuming that the standard modules are loaded):

    > Connect-VIServer [vcenterServer]

    > $vmTags = get - VM | Get-TagAssignment

    > $vmTags

    List entity as ' [CustomField1Name] [CustomField2Name]... [CustomFieldnName] [VMName] »

    Interestingly, registration $vmTags.Entity.Name will be back in reality than the names themselves (without names CustomAttribute) virtual machine. So, it's still usable for name matching.

    If it's something specific to my environment, someone has any ideas on what could be the cause of this?

    Confirmed, this is indeed a bug.

    The @entity.name of the TagAssignment object property, has all the custom attribute names and the name of the entity.

  • Updating of database without using RMAN duplicate

    Hi all

    I intend to update my test instance in a PIT using backups RMAN of PROD. I would like to know the process without being connected to the PROD database and without using RMAN dual.

    Thank you.

    Imran khan says:
    Please delete your concepts about the process of backup and restore RMAN... It is not possible to update your db test for prod db RMAN backup parts without using RMAN dual and without connecting to the PROD database...
    I would be very surprised if you can get this answer to your pointless question...

    It is most details too throw an insult while making false statements on the displayed issue.
    Maybe you are the one who does not know how to use rman.

    There is a way to clone (refresh) a database of development of a backup of the production without using the command DUPLICATE.

    In summary, you must do this:

    (1) with rman, restore the backup piece controlfile.
    (2) startup mount
    (3) with rman, restore the database.
    (4) recover database using backup controlfile until Cancel.
    (5) use the 'nest' utility to change the name of the database.

    Good luck!

    : p

  • I want the single update query without using the function.

    I want to update sells_table selling_code field with product_code date product table max.
    In the product table, there are several product_code date wise.

    I did with below charly with the use of the service, but we can do in the query what a single update
    without using the function.

    UPDATE sells_table
    SET selling_code = MAXDATEPRODUCT (ctd_vpk_product_code)
    WHERE NVL(update_product_flag,0) = 0;

    (P_product IN VARCHAR2) RETURN of HVL.maxdateproduct NUMBER FUNCTION to CREATE or REPLACE
    IS
    max_date_product VARCHAR2 (100);
    BEGIN
    BEGIN
    SELECT NVL (TRIM (product_code), 0)
    IN max_date_product
    FROM (SELECT product_code, xref_end_dt)
    PRODUCT
    WHERE TO_NUMBER (p_product) = pr.item_id
    ORDER BY xref_end_dt DESC)
    WHERE ROWNUM = 1; -He'll be back a single line - max date product code
    EXCEPTION
    WHILE OTHERS
    THEN
    RETURN 0;
    END;

    RETURN max_date_product;

    END maxdateproduct;

    Thanks in advance.

    Hello

    Something like that.

    update setlls_table st
            set selling_code =(select nvl(trim(product_code)) from
                                  (select product_code
                                          , rank() over (partition by item_id order by xref_end_dt DESC) rn
                                       from product
                                   ) pr
                                   where rn =1
                                         and pr.item_id = st.ctd_vpk_product_code
                               ) where NVL(update_product_flag,0) = 0 ;
    

    That such is not tested due to lack of sampling input.

    Concerning
    Anurag Tibrewal.

  • How can I get through forms without using my mouse?

    On a form web (as a survey), I used to be able to tab on the 'submit' button, press ENTER, and submit the page. Who stopped working some time over 2 months, probably with an update of Firefox.

    I need to have people to do a series of short surveys, a typed RESPONSE per page. (They must be structured in this way for a moment that we do). Previously, people could type in their response, to 'other' tab and press return, which would load the next page. This seems to have stopped working, and I can't find a way to access the next page without using the mouse. Back and forth between typing and clicking on are super annoying and slow people down, by our much less precise time measurements. How can I return this feature?

    Seems to work for me. I did this quick form with Google Drive: https://docs.google.com/forms/d/1b493Op_imKXg8Q_GNMmRquuvCutZzyQ0RuQbgKRPD6A/viewform?usp=send_form
    Can you give an example of this form does not work?

  • Error codes: Code 80070005, I cannot update Windows... I used the Unility FixCleaner but I still get the same error message. How cal I solve this problem?

    Error codes: Code 80070005, I cannot update Windows... I used the Unility FixCleaner but I still get the same error message. How can I fix?

    http://social.technet.Microsoft.com/forums/en/itprovistasetup/thread/95edbee4-a75c-48AD-91D1-5316a96f9567

    http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.windowsupdate&tid=1ab369b4-7d27-4951-8047-09c861ff5bc1&cat=en_US_d02fc761-3f6b-402c-82f6-ba1a8875c1a7&lang=en&cr=&sloc=en-us&m=1&p=1

    See if the information above solves the problem.

    If this is not the case, try the Windows Update Forum, the link below:

    You will get the best help for any problem of Update/Service Pack in the Windows Update Forum; the link below:

    http://social.answers.Microsoft.com/forums/en-us/vistawu/threads

    When you repost here, kindly include the Error Codes, and exactly what is happening when you try to update.

    In this way, you will receive the best help.

    See you soon.

    Mick Murphy - Microsoft partner

  • Instantis 9.0 - custom fields can be updated when importing

    Sure that the answer is no, but thought I would check to make sure.

    The custom field to project are available on the tab Instantis_Financial_Parameters in the export of the financial model for a project. It's a one-way simple push, right?  Impossible to update the Instantis infield by changing it on the spreadsheet and import, correct?

    You import the area directors or of export/import in the field of project finance.  You must enable the possibility to import and export in the project.  If you do, you cannot update manually or have a calculated field.  You are locked.

    An import from spreadsheet (saved in a zip file), should be updated all custom fields.

Maybe you are looking for

  • Excess of communities to Support Apple Mail

    I canceled all my subscriptions, communities Support from Apple and I keep getting 1 mail electronic rpm of communities? What I, ve to to?

  • Windows rescue team

    HelloI received a call from a woman attached to a team called Windows Rescue team. When I told her off the coast, she threatened to unplug my internet because I have a few worms and malware that infect other computers and they got my CSL of Windows c

  • On the EOS 60 d is the LCD display of the screen by default for aiming/development/taken view photo?

    When I turn on the camera and press the 'camera' button I can only see my scene through the LCD - the viewfinder is dark. If I press the button of the camera again, the viewfinder opens. Have I not the wrong preset somewhere?

  • Outlook express compacting messages

    I get a notification "Compact Messages" on my screen all few seconds and it, s becomes a bit of an impasse, I tried Havre Regedit and changing values, as has been suggested by some forums. How can I stop the message flaqshing up on top of my screen

  • Is it OK to run Disk Cleanup and remove temporary files?

    original title: disk cleanup and delete temporary files I am a novice computer person, I need to know if it is allowed to run Disk Cleanup and remove temporary files, who says that some programs store information in files temp, not temporary internet