viPerl: list specific custom attributes for specific VM

I would be able to simply move the VM name and the name of the custom function and that perl attribute returns the value... Does anyone have a script for this?

So I wrote this quickly enough, but basically the fact that you are looking for.  You have to kind of match a value of index (key) between [] properties customValue and list of the custom fields CustomFieldsManager object.

#!/usr/bin/perl -w

use strict;
use warnings;

use VMware::VIRuntime;

my %opts = (
     vmname => {
     type => "=s",
     variable => "VMNAME",
     help => "Name of virtual machine.",
     required => 1,
     },

     customfield => {
     type => "=s",
     variable => "CUSTOMFIELD",
     help => "Name of a custom field to retrieve a value from.",
     require => 1,
     },
);

Opts::add_options(%opts);
Opts::parse();
Opts::validate();

Util::connect();

my ($vm_view, $vm_name, $custom_field, $customFieldsMgr, $sc);

$vm_name = Opts::get_option("vmname");
$custom_field = Opts::get_option("customfield");

$vm_view = Vim::find_entity_view(
     view_type => "VirtualMachine",
     filter => { 'name' => $vm_name },
     properties => \[ 'name', 'summary' ], # Remove the '\' before '[' here, forum mangles it without an escape.
);

unless ( defined $vm_view ) {
     die "Virtual Machine, '$vm_name', not found.\n";
}

$sc = Vim::get_service_content();
$customFieldsMgr = Vim::get_view( mo_ref => $sc->customFieldsManager );

unless ( (defined $vm_view->summary) && defined($vm_view->summary->customValue) ) {
     print "No custom values defined for virtual machine, '$vm_name'.\n";
}
else {
     # Get the field key value from the supplied custom field name
     my $field_key = undef;
     if ( defined $customFieldsMgr->field ) {
          foreach (@{$customFieldsMgr->field}) {
               if ( $_->name eq $custom_field ) {
                    $field_key = $_->key;
               }
          }
     }

     unless ( defined $field_key ) {
          die "No custom field named '$custom_field' found.\n";
     }

     my ($value, $key);
     foreach ( @{$vm_view->summary->customValue} ) {
          $key = $_->key;
          $value = $_->value;

          if ( $key eq $field_key ) {
               print "Virtual Machine: $vm_name\n";
               print "   $custom_field = $value\n";
          }
     }
}

Util::disconnect();

Edit: Find the comment to remove a front backslack the ' [' character, the forum mangles it if I do not here.]

Tags: VMware

Similar Questions

  • custom attributes for a virtual machine or more

    is it possible to create a custom attribute for VMA, lets say "data center region", then look for this attribute later.

    You can use the cmdlet New-CustomAttribute to create custom attributes (you can also do this through the client, but this is the forum PowerCLI!).

    You can then use the cmdlet Get-CustomAttribute to query what attributes to define in your vCenter.

    And to get the value of the attribute of an object, the CustomFields property contains an array of all the custom attributes.

    for example ((get-vm vm).) CustomFields | Where {$_.} The key - eq 'attributeName' value})

  • Custom attribute editor changes in activating Contributor mode is not the Save"" button.

    We wrote a custom with two boxes attribute editor and save the two values in a single field. The part of the user interface of its works very well. But the problem we have is when you change a value of these custom attributes for an asset in contributor 'Save' mode is not getting activated as expected. To save the values of this custom attribute Editor, must modify any other attribute of asset values and then save the assets to save the values of the modified attributes.  Please find the code for the item below

    <%@ taglib prefix="cs" uri="futuretense_cs/ftcs1_0.tld"
    %><%@ taglib prefix="ics" uri="futuretense_cs/ics.tld"
    %>
    <cs:ftcs>
    <ics:setvar name="doDefaultDisplay" value="no"/>
    <tr>
        <ics:callelement element="OpenMarket/Gator/FlexibleAssets/Common/DisplayAttributeName"/>
        <td></td>
        <td>
      <select name="Integers" id="Integers" onChange="javascript:saveChanges()" dojoType="fw.dijit.UISimpleSelect" showErrors="false" clearButton="true" size="1">
      <option value="1">1</option>
      <option value="2">2</option>
      <option value="3">3</option>
      <option value="4">4</option>
      <option value="5">5</option>
      <option value="6">6</option>
      </select>
      <select name="Units" id="Units" onChange="javascript:saveChanges()" dojoType="fw.dijit.UISimpleSelect" showErrors="false" clearButton="true" size="1">
      <option value="days">Days</option>
      <option value="hours">Hours</option>
      <option value="mins">Mins<option>
      </select>
         
        </td>
    </tr>
    <input type="hidden" id="IntegerUnitsValue" name='<%=ics.GetVar("cs_SingleInputName")%>' value='<%=ics.GetVar("Integers")+"-"+ics.GetVar("Units")%>'/>
     <ics:if condition='<%="true".equals(ics.GetVar("RequiredAttr"))%>'>
      <ics:then>
      <ics:setvar name="RequireInfo" value='<%="*" + ics.GetVar("cs_SingleInputName") + "*" + ics.GetVar("currentAttrName") + "*ReqTrue*" + ics.GetVar("AttrType") + "*text!" %>'/>
      </ics:then>
      <ics:else>
      <ics:setvar name="RequireInfo" value='<%="*" + ics.GetVar("cs_SingleInputName") + "*" + ics.GetVar("currentAttrName") + "*ReqFalse*" + ics.GetVar("AttrType") + "*text!" %>'/>
      </ics:else>
      </ics:if>
       <%
            String value = ics.GetVar("ContentDetails:" +ics.GetVar("cs_SingleInputName"));
            value = value!=null?value:"";
      String[] integerunits=new String[2];
      if(value.length()>0 && value.indexOf("-")>0){
      integerunits=value.split("-");
       %>
      <script language="JavaScript">
      var interunitsSize=<%=integerunits.length%>;
      var integerValue="<%=integerunits[0]%>";
      var unitValue="<%=integerunits[1]%>";
    
      var integersObj = document.getElementById('Integers');
      var unitsObj = document.getElementById('Units');
      for(i=0;i<integersObj.options.length;i++){
      if(integersObj.options[i].value==integerValue){
      integersObj.options[i].selected=true;
      }
      }
      for(i=0;i<unitsObj.options.length;i++){
      if(unitsObj.options[i].value==unitValue){
      unitsObj.options[i].selected=true;
      }
      }
      function saveChanges(){
      var IntegerUnitsValue=document.getElementById("IntegerUnitsValue");
      var integersObj = document.getElementById('Integers');
      var unitsObj = document.getElementById('Units');
       IntegerUnitsValue.value=integersObj.options[integersObj.selectedIndex].value+"-"+unitsObj.options[unitsObj.selectedIndex].value;
       }
      </script>
      <%}%>
     </cs:ftcs>
    
    
    

    Found the answer to this issue of support. I need to include "setTabDirty();" in the javascript function.

  • Why getter VO is not called for custom attributes of VO?

    Hello

    The requirement is to add two or three fields on a page of the OFA. Here's what I did:

    -Created VO personalized by extending the standard VO
    -Added fields to the page through customization.

    The problem is that the values for the custom page fields were not. Investigation, I found that the accessor Get of VORowImpl getAttrInvokeAccessor was not called for my custom attribute. I tried to check the difference between the attributes for which the Get accessor is called, and for whom it has not named. I could not find and I'm totally clueless as to what determines the get accessor to be called.

    Really appreciate your help to move forward.

    Thank you
    Anil

    Published by: AnilMenta on March 5, 2013 10:40

    Hi Anil,
    Unless the attribute is not used in the user interface or other calls,
    the Get accessor will be called
    Make sure you've got the attribute used to get your custom attribute named getter.

    You mentioned that you started to use in customization, it is always the problem persists?

    Thank you

    With respect,
    Kali.
    OSSi.

  • Custom attribute in the model layer properties

    Hey all,.

    Can someone explain the flow of the program "ADF practice: using custom attribute in the model layer properties of". "" Basically, how change custom properties like "customLabel" changed the label attribute. Is there properties specific adf we can refer to properties for the attribute?

    Reference will also be useful.

    Thank you!!

    What exactly you want to know?

    It's pretty clear from what I've read:

    You can set properties that are customized for each attribute in a vo. This is done in the vo attributes dialog box where the default value.

    You can override the default values that is done in the setCustomHints() method. This method is called by the button in the user interface (actionListener = "#{bindings.setCustomHints.execute}" ")

    The inputtext is set to display the properties for the label (label = "#{bindings.") DepartmentName.hints.customLabel}') and uses the custom readOnly property (readonly = "#{bindings.") DepartmentName.hints.readonly}')

    As the inputText component is updated after the button clicked on (via a pertial in the inputText trigger), it shows the a values.

    Timo

  • Set different attributes for different type of content or profile

    Hi all

    I use ucm10g, my client asked me if it is possible to set different attributes for different type of content or profile.

    I know that using the profile when checkin, content display information or research, content server just show me attributes belong to only one profile, but internally, several other attributes are always available for that content, it is a resource size? as the other attributes are not allowed for this business view content, is it possible to not allow other attributes for this content in this case?

    Best regards

    In short, no it's not possible.

    Basically, some ECM systems will create the tables of specific database for each content type store that content type-specific metadata.

    University Complutense of MADRID takes a simpler approach. All custom metadata are stored in the DocMeta table and the standard fields are in the table of revisions. So if you have documents that do not use some fields, you get "null in your database - I don't think it's a huge waste of resources that the DB does not really use a lot of storage in this way."

    Having in general many areas can reduce the performance of loading search page and very slightly so it is advisable to try to keep the number of fields to a manageable level.

    Hope that answers your question

    Tim

  • VC of custom attributes in a report or dashboard

    Hello
    Is there a way to get a specific custom attribute in a report or dashboard?
    I create a query but I do not see how to select a specific attributes of the VC
    Kind regards
    Ronald

    Hello Ronald.
    Are you collecting VC of custom attributes? What does the collector agent configuration file (foglightagent.winservice.exe.config) see flag below the?


    Fake

    If you collect those then below article should help:
    vcommunity.Vizioncore.com/.../Easily-Create-vFoglight-services-based-on-vCenter-Custom-Attributes.aspx
    Concerning

  • Reporting to include custom attributes of Vm and organized through multiple vcenters.

    Hello
    We are just moving our production test vfoglight solution & have you come across a bit of a weird one. We had a report / discovers that would list all virtual machines in our virtual Center and displays the custom attributes in a nice - good for the management report, form etc. However, we are moving to a new instance of virtual center & we have a test instance too - all are present in vfoglight, but our report draws only the custom of the original vcentre attributes. I'm not wcf script guru, but I gave it a good look & can't see a way forward - the hero of any script out there who could take a look and help out?
    Moreover, do you think I could put in a request for support for this one & get any joy?

    Hope someone can help - I'll post all the files needed etc.

    Kind regards

    Jonathan

    Thought of it at the end - on the second vcenter vmware foglight agent did not have the ability to collect custom attributes in the service.config file set to true. After true and restart the collector and the connector, everything was fine.

  • Custom attribute in the patch ACS4.2 17

    I have an optional custom attribute in my ACS group to pass on ACE config mode: shell: Admin * Admin by default-field

    Privilege level 15 is also part of the configuration of the exec.

    Recently I applied the patch 17 on ACS 4.2 (0) build 124. Since then I can not connect with the level of privilege 15 in IOS routers/switches.

    Looks like IOS box considers this attribute custom as a mandatory now.

    ---------------------------------------------------------------------------------------------------

    Debugging IOS (Cat6500, 12.2 (33) SXJ4):

    May 27, 13:23:56.819: MORE: application created for 61929 (pehruby)

    May 27, 13:23:56.819: MORE: previously set server group Ganymede 10.105.24.44 +.

    May 27, 13:23:56.819: HIGHER (0000F1E9) / 550052 A-4/NB_WAIT/0: started 5 sec timeout

    May 27, 13:23:56.819: HIGHER (0000F1E9) / 0/NB_WAIT: made event 2

    May 27, 13:23:56.819: HIGHER (0000F1E9) / 0/NB_WAIT: 62 bytes written requests

    May 27, 13:23:56.819: HIGHER (0000F1E9) / 0/READING: made event 1

    May 27, 13:23:56.823: HIGHER (0000F1E9) / 0/READING: would block during playback

    May 27, 13:23:56.823: HIGHER (0000F1E9) / 0/READING: made event 1

    May 27, 13:23:56.823: HIGHER (0000F1E9) / 0/READING: read all 12 byte header (wait for data 51 bytes)

    May 27, 13:23:56.823: HIGHER (0000F1E9) / 0/READING: made event 1

    May 27, 13:23:56.823: HIGHER (0000F1E9) / 0/READING: read all the answer 63 bytes

    May 27, 13:23:56.823: HIGHER (0000F1E9) / 0 / 550052 A 4: the package of treatment response

    May 27, 13:23:56.823: MORE: handled AV priv-lvl = 15

    May 27, 13:23:56.823: MORE: could not decode a unknown AV hull: FAIL

    May 27, 13:23:56.823: HIGHER (0000F1E9) / 0/REQ_WAIT / 550052 A 4: expired

    May 27, 13:23:56.823: MORE: Protocol is set to None. Jump

    May 27, 13:23:56.823: MORE: AV = shell shipping service

    May 27, 13:23:56.823: MORE: sending AV cmd *.

    ACS TCS.log (different time, same attempt):

    TC 27/05/2013 11:59:39 I 0043 5088 0 X 15< packet="" to="" client:10.106.11.114="" type:author/pass_add,="" seq="" 2,="" flags="">

    TC 27/05/2013 11:59:39 I 0043 5088 0 X 15 SESSIONID-998342923 (0XC47E7EF5), DATALEN 51 (0 X 33)

    TC 27/05/2013 11:59:39 type I 0043 5088 0 x 15 = AUTHOR/RESPONSE status = 1 (AUTHOR/PASS_ADD)

    TC 27/05/2013 11:59:39 I 0043 5088 0 x 15 msg_len = 0, data_len = 0 arg_cnt = 2

    TC 27/05/2013 11:59:39 I 0043 5088 0 x 15 size arg [0] = 11 = priv-lvl = 15

    TC 27/05/2013 11:59:39 I 0043 5088 0 x 15 size arg [1] = 32 = shell: Admin * Admin by default-field

    TC 27/05/2013 11:59:39 I 0043 5088 0 x 15 end >

    ------------------------------------------------------------------------------------------------------------------------

    Debugging IOS (C1841, 12.3 (14) T7):

    May 30, 12:21:58.248: AAA/BIND(00000A52): link i / f

    12:21:58.272 30 may: AAA/AUTHOR (0xA52): list of selection method "acs."

    12:21:58.272 30 may: MORE: AAA Queuing 2642 authorization for treatment

    12:21:58.272 30 may: HIGHER: processing of the application for authorization id 2642

    12:21:58.272 30 may: MORE: Protocol is set to None. Jump

    12:21:58.276 30 may: MORE: AV = shell shipping service

    12:21:58.276 30 may: MORE: sending AV cmd *.

    12:21:58.276 30 may: MORE: application created for 2642 (ph)

    12:21:58.276 30 may: MORE: previously set server group Ganymede 10.105.24.44 +.

    12:21:58.276 30 may: HIGHER (A 00000, 52) / 656FB000/NB_WAIT/0: started 5 sec timeout

    12:21:58.276 30 may: HIGHER (A 00000, 52) / 0/NB_WAIT: made event 2

    12:21:58.276 30 may: HIGHER (A 00000, 52) / 0/NB_WAIT: 59 bytes written requests

    12:21:58.276 30 may: HIGHER (A 00000, 52) / 0/READING: made event 1

    12:21:58.276 30 may: HIGHER (A 00000, 52) / 0/READING: would block during playback

    12:21:58.280 30 may: HIGHER (A 00000, 52) / 0/READING: made event 1

    12:21:58.280 30 may: HIGHER (A 00000, 52) / 0/READING: read all 12 byte header (wait for data 51 bytes)

    12:21:58.280 30 may: HIGHER (A 00000, 52) / 0/READING: made event 1

    12:21:58.280 30 may: HIGHER (A 00000, 52) / 0/READING: read all the answer 63 bytes

    12:21:58.280 30 may: HIGHER (A 00000, 52) / 0/656FB000: the package of treatment response

    12:21:58.280 30 may: MORE: handled AV priv-lvl = 15

    12:21:58.280 30 may: MORE: could not decode AV shell: Admin * Admin by default-field - PASS - PASS

    May 30, 12:21:58.284: AAA/AUTHOR/EXEC(00000A52): AV cmd = treatment

    May 30, 12:21:58.284: AAA/AUTHOR/EXEC(00000A52): successful authorization

    ACS.log:

    TC 30/05/2013 12:21:58 I 0043 1280 0 X 0< received="" from="" client:10.106.0.50="" type="AUTHOR," seq="1," flags="">

    TC 30/05/2013 12:21:58 I 0043 1280 SESSIONID 0 X 0 1990425999 (0X76A37D8F), DATALEN 47 (0X2F)

    TC 30/05/2013 12:21:58 I 0043 1280 type 0 x 0 = AUTHOR, priv_lvl = 1, authentic = 1

    TC 30/05/2013 12:21:58 I 0043 1280 0 x 0 METHOD = Ganymede +.

    TC 30/05/2013 12:21:58 I 0043 1280 SVC 0 X 0 = 1 USER_LEN = 2 PORT_LEN = 6 REM_ADDR_LEN = 12 ARG_CNT = 2

    TC 30/05/2013 12:21:58 I 0043 1280 0 x 0 USER = ph

    TC 30/05/2013 12:21:58 I 0043 1280 PORT 0 x 0 = tty195

    TC 30/05/2013 12:21:58 I 0043 1280 0 X 0 = 10.106.33.22 REM_ADDR

    TC 30/05/2013 12:21:58 I 0043 1280 0 x 0 arg [0](size=13) = service = shell

    TC 30/05/2013 12:21:58 I 0043 1280 0 x 0 arg [1](size=4) = cmd *.

    TC 30/05/2013 12:21:58 I 0043 1280 0 X 0 END >

    TC 30/05/2013 12:21:58 I 0850 3244 1 allocated connection wire work unique 0xf

    TC 30/05/2013 12:21:58 I 0143 3244 0xf author data: phtty19510.106.33.22service = shellcmd. = 13362timezone = MEZservi

    TC 30/05/2013 12:21:58 I 0163 3244 0xf - excerpts from the info service

    TC 30/05/2013 12:21:58 I have 0189 3244 0xf - Checked NARs

    TC 30/05/2013 12:21:58 I 0199 3244 0xf - implemented Reqs:

    TC 30/05/2013 12:21:58 I 0209 3244 0xf - a profile

    TC 30/05/2013 12:21:58 I 0261 3244 0xf - executed

    TC 30/05/2013 12:21:58 I 0263 3244 0xf - set of controls done clean

    TC 30/05/2013 12:21:58 I 0265 3244 0xf - version NDG provided

    TC 30/05/2013 12:21:58 I 0043 3244 0XF< packet="" to="" client:10.106.0.50="" type:author/pass_add,="" seq="" 2,="" flags="">

    TC 30/05/2013 12:21:58 I 0043 3244 SESSIONID 0XF 1990425999 (0X76A37D8F), DATALEN 51 (0 X 33)

    TC 30/05/2013 12:21:58 I 0043 3244 0xf type = AUTHOR/RESPONSE status = 1 (AUTHOR/PASS_ADD)

    TC 30/05/2013 12:21:58 I 0043 3244 0xf msg_len = 0, data_len = 0 arg_cnt = 2

    TC 30/05/2013 12:21:58 I 0043 3244 0xf arg [0] size = 11 = priv-lvl = 15

    TC 30/05/2013 12:21:58 I 0043 3244 0xf arg [1] = 32 = shell size: Admin * Admin by default-field

    TC 30/05/2013 12:21:58 I 0043 3244 0xf end >

    PuTTY session:

    Connect as: ph

    [email protected]/ * / password:<------ (10.106.0.16="" and="" 10.106.0.50="" are="" ip="" addresses="" of="" the="" same="">

    1841_hra_lab >

    1841_hra_lab ><------ i'm="" not="" in="" enable="" mode="" (priv.level="">

    --------------------------------------------------------------------------------------------------------------------

    Unfortunalety I don't have newspapers/debug of the period before the update, when everything was ok.

    I guess that the problem is somewhere in this argument that goes from the ACS to the customer:

    TC 30/05/2013 12:21:58 I 0043 3244 0xf arg [1] = 32 = shell size: Admin * Admin by default-field

    Can someone tell me how this argument with the option setting should look like?

    Maybe * shell: Admin * Admin by default-field?

    Petr

    Hi Peter,

    You are using in a default.

    CSCth75577    ACS incorrectly sends optional custom attributes GANYMEDE +.

    Symptom:

    Authorization GANYMEDE + IOS fails if client attributes (even as an option) are configured on the ACS user group.  The connection will work, but the attributes passed will be not honored.

    Conditions:

    ACS 4.2.0.124 patch 16

    ACS 4.2.1.15 patch 2

    Workaround solution:

    Return to a previous fix ACS.

    This problem has been fixed in

    ACS 4.2.1.15 patch 3 or later.

    Upgrade of the ACS to 4.2.1.15 and apply the latest patch 10.

    Jatin kone
    -Does the rate of useful messages-

  • Change the VM with custom attributes defined in a CSV file

    Hi all

    I'm doing something that I think should be simple (but this is the first time I used powercli and am not a good code writer), but I find it hard to tell.

    I created 2 custom attributes (owner and owner of the SSG system) in vCenter for my virtual machines.  I have a list of vm names csv and their associates "owners".  I would use powercli to read the csv file and connect to the VC server and the 'owners' of entry in the appropriate field.

    I borrowed com code from various places on the internet and these forums but I can't seem to make it all work.  I managed at least to read the information in the csv file and is displayed on the screen of my laptop.  What I can't do is get 3 columns in the csv file to be recognized as variables (unless there is some default variables I don't know) I can put in the game-Annotation lines.

    The code I have is:

    # Input range, includes all IBD VM names that are registered.
    $data = import-Csv "C:\Program Files (x 86) \VMware\Infrastructure\vSphere PowerCLI\scripts\vmowners1.csv"-Header ('Hostname', 'Owner', 'SSG owner')
    # $data | Get-Member
    Write-Output $data
    # Loop over all the VMS in vCenter
    ForEach ($row in $data)
    {
    # Create variables for the current virtual and its 'Contact' and 'Description' computer that are custom attribute fields.  Also create a $note string to use Set-VM-Description
    $hostname = get-VM-name $vmname;
    # $contact = $vm | Get-Annotation CustomAttribute - user;
    # $description = $vm | Get-Annotation - CustomAttribute Description;
    # $note = $contact.name + ":'t" + $contact.value + "' not n" + $description.name + ":'t" + $description.value;
    Set Annotation - entity $hostname - CustomAttribute "Business system owner" - value $SSG_owner
    Set Annotation - entity $hostname - CustomAttribute "SSG system owner" - value $system_owner
    # Set - VM - VM $vm - $note Description - confirm: $false;
    }

    The result, I get on my screen is:

    PowerCLI C:\Program Files (x 86) \VMware\Infrastructure\vSphere PowerCLI\scripts >.\setvmownership.ps1

    Owner of the company that owns SSG host name

    --------                                              --------------                                       ---------

    ABPPROXY-00-AH

    ACE-01-AH hung Laallmmi hung Laallmmi

    Get - VM: could not validate the argument on the parameter 'name '. The argument is null or empty. Provide an argument that is not null or empty, and then try the AGM of the order

    in.

    To C:\Program Files (x 86) \VMware\Infrastructure\vSphere PowerCLI\scripts\setvmownership.ps1:13 char: 29

    + $hostname = get-VM-name < < < < $vmname;

    + CategoryInfo: InvalidData: (:)) [Get - VM], ParameterBindingValidationException)

    + FullyQualifiedErrorId: ParameterArgumentValidationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVM

    Set Annotation: Impossible to validate the argument on the parameter "entity". The argument is null. Supply a non-null argument, and try the command again.

    C:\Program Files (x 86) \VMware\Infrastructure\vSphere PowerCLI\scripts\setvmownership.ps1:17 char: 23

    + Set-Annotation - entity < < < < $hostname - CustomAttribute "Business system owner" - value $SSG_owner

    + CategoryInfo: InvalidData: (:)) [game-Annotation], ParameterBindingValidationException)

    + FullyQualifiedErrorId: ParameterArgumentValidationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.SetAnnotation

    Set Annotation: Impossible to validate the argument on the parameter "entity". The argument is null. Supply a non-null argument, and try the command again.

    C:\Program Files (x 86) \VMware\Infrastructure\vSphere PowerCLI\scripts\setvmownership.ps1:18 char: 23

    + Set-Annotation - entity < < < < $hostname - CustomAttribute "SSG system owner" - value $system_owner

    + CategoryInfo: InvalidData: (:)) [game-Annotation], ParameterBindingValidationException)

    + FullyQualifiedErrorId: ParameterArgumentValidationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.SetAnnotation

    Get - VM: could not validate the argument on the parameter 'name '. The argument is null or empty. Provide an argument that is not null or empty, and then try the AGM of the order

    in.

    To C:\Program Files (x 86) \VMware\Infrastructure\vSphere PowerCLI\scripts\setvmownership.ps1:13 char: 29

    + $hostname = get-VM-name < < < < $vmname;

    + CategoryInfo: InvalidData: (:)) [Get - VM], ParameterBindingValidationException)

    + FullyQualifiedErrorId: ParameterArgumentValidationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVM

    Set Annotation: Impossible to validate the argument on the parameter "entity". The argument is null. Supply a non-null argument, and try the command again.

    C:\Program Files (x 86) \VMware\Infrastructure\vSphere PowerCLI\scripts\setvmownership.ps1:17 char: 23

    + Set-Annotation - entity < < < < $hostname - CustomAttribute "Business system owner" - value $SSG_owner

    + CategoryInfo: InvalidData: (:)) [game-Annotation], ParameterBindingValidationException)

    + FullyQualifiedErrorId: ParameterArgumentValidationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.SetAnnotation

    Set Annotation: Impossible to validate the argument on the parameter "entity". The argument is null. Supply a non-null argument, and try the command again.

    C:\Program Files (x 86) \VMware\Infrastructure\vSphere PowerCLI\scripts\setvmownership.ps1:18 char: 23

    + Set-Annotation - entity < < < < $hostname - CustomAttribute "SSG system owner" - value $system_owner

    + CategoryInfo: InvalidData: (:)) [game-Annotation], ParameterBindingValidationException)

    + FullyQualifiedErrorId: ParameterArgumentValidationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.SetAnnotation

    The CSV file looks like this (but continues for about 500 VMS):

    I go with the option import-csv because that said something that I read in my troubleshooting efforts would empty columns and error I received and that import-csv correctly would intrepret in empty columns.

    hostname, business_owner, system_owner,

    ABPPROXY-00-AH,

    ACE-01-AH, James Laallmmi, James Laallmmi,

    acrodev-00-ah, tflessa, Bruce Hastings,.

    ACT1DDB00AH, Bill Mancini, Mike Bruni,

    ACT1TDB00AH, Bill Mancini, Mike Bruni,

    What should I do to be able to get this script to work? I don't know that it is related to messages "argument is null." that we see in the output.

    Thank you

    Dan

    Hello, dscottimw-

    You were on the right track.  There were a couple of things to change to make it work as you want:

    1. either remove the "-header" part of the Import-Csv line or delete the actual header of the CSV itself - these are elements in conflict (the "-Header" param names of the columns in the CSV and assumes that the CSV file has already no header row)
    2. you need to access the properties of the $row variable in the ForEach loop - not only call the names of the CSV column headers (this is why you may receive errors on things 'null' - whether you use variables that have no value)

    Try this:

    # Input array, includes all VM names from DCI that are registered.$arrVMsInfo = Import-Csv "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\scripts\vmowners1.csv"#Write-Output $data
    
    ## loop through all VMs listed in the CSV, setting custom attrib values for eachForEach ($row in $arrVMsInfo) {    ## get the VM for this row    $vmThisOne = Get-VM -Name $row.hostname    Set-Annotation -Entity $vmThisOne -CustomAttribute "Business System Owner" -Value $row.business_owner    Set-Annotation -Entity $vmThisOne -CustomAttribute "SSG System Owner" -Value $row.system_owner} ## end foreach
    

    And, to give it a shot without actually play the game on annotations, to make sure things go as you like, you could add a - WhatIf to each line in Set-Annotation in the ForEach loop.

    Which works better for you?

  • Custom template for related products?

    So, this is the first time I try to customize an ecommerce solution beyond the normal stuff of the BC. Customer wants a specific view for related products, so my first thought was to use a custom template, but it doesn't seem to work.

    So I almost with the help of the model of module, a decline in the amount of 1 - and hoping I can use a custom template for the display of the small product instead since I use that related products.

    I forgot something? Is it possible to use a custom template for the {tag_relatedproducts}?

    Thank you Joel however I have more control over the layout as a few styles of it. I ended up jumping in with the beta version of liquid to get what I need, what gave me some other customizations.

    TAGS cannot take a custom template variable, I chose to store it in a tag "capture." So based on some conflicts of naming of my catalog images, I was able to target specific catalogs, then browse related products and build them up as I wanted.

    Here is an example of what I chose to go with.

    {capture products %} %

    {tag_productlist, true true, 3,}

    {% for %} endcapture

    model {module_catalogue catalogId = "{{this.id"}} "=" "collection ="cat"}

    {tag_name}

    {% If {cat.imageUrl} contains 'show' and ({{this.id}} == {{tag_productlist_5_8.catalogId}}%}}

    {tag_productlist, true true, 3,}

    {% elsif {cat.imageUrl} contains "display" %}

    {% for %} tag_productlist_5_8.items products

    REF #: {{product.custom3}}

    MFG #: {{product.custom2}}

    Price: {{product.saleprice}}

     

    {% endfor %}

    {% products.items %} elsif

    {tag_cataloguelist, true true, 2,}

    {% for %} tag_catalogueList_3_9.items products

    Price: {{product.saleprice}}

    {% endfor %}

    {% other %}

    {tag_cataloguelist, true true, 2,}

    {tag_productlist, true true, 3,}

    {% endif %}

  • How to create a dynamic custom attribute?

    I would like to create a custom attribute of type 'Host' that would dynamically update listing the number of guests on each host.  It would be same information on every host on the summary, General Section tab, Virtual Machines.

    It would be extremely useful, I'd be able to say to an ice cream which was underused host without having to check each host.

    This should be solved with a script.

    If this is in the wrong community then please move.

    I use VC 2.5 update 4 with ESX 3.5 update 3.

    Thanks in advance for any help with this.

    jfatheree

    Attached is the script, part of the code was mutilated by the forum.

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

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    repository scripts vGhetto

    http://Twitter.com/lamw

    If you find this information useful, please give points to "correct" or "useful".

  • To find existing custom reports for a module

    Hi all

    We have a requirement in which we want to find the existing custom reports for a particular module.
    I would like to confirm will help the following query:

    SELECT annual doc_name, doc_developer_key, doc_folder_id
    DOC eul5_us.eul5_documents
    WHERE doc_name AS < workbook name >

    The 'eul5_documents' table also contains the data of standard reports. If this is the case what specific verification, I need to extract only the customized reports.

    Kind regards
    Shruti

    Hi shruti,

    find existing custom reports for a particular module.

    The query you've written works very well. But for particular module as you say, you add the fnd_responsibility to the query.
    If you want to ge the details of reports customized.

    There is no such thing of specific check to find custom reports.

    I hope this helps. More than problems let us know.

    Best wishes
    Murielle.

  • When you send an e-mail using Outlook Express, I immediately get this message; "Some errors occurred while processing the requested tasks. Please see the list of errors below for more details"

    When you send an e-mail using Outlook Express, I immediately get this message; "Some errors occurred while processing the requested tasks. Please see the list of errors below for more details". Unfortunately, there are no errors listed below and the green bar is frozen on the screen. The message remains in my Outbox and repeated again and again sending. There is absolutely no record and file sent in my sent box. TIA - Ernie

    You have apparent dbx file corruption. A common problem.
     
    Spend most of your messages out of the Inbox and then create new folders to send and sent items box after having moved the messages you want to save to a local folder that you create.
     
    Tools | Options | Maintenance | Store folder will reveal the location of your Outlook Express files. Note the location and navigate on it in Explorer Windows or, copy and paste in start | Run.
     
    In Windows XP, Win2K & Win2K3 the OE user files (DBX and WAB) are by default marked as hidden. To view these files in Windows Explorer, you must enable Show hidden files and folders under start | Control Panel | Folder Options icon | Opinion, or in Windows Explorer. Tools | Folder options | View.
     
    With OE closed, find the DBX files for the items in the Outbox and sent and delete them.  New ones will be created automatically when you open OE.
     
    After you're done, followed by compacting your folders manually while working * off * and do it often.
     
    Click Outlook Express at the top of the the folder tree so no folders are open. Then: File | Work offline (or double-click on work online in the status bar). File | Folder | Compact all folders. Don't touch anything until the compacting is completed.
     
    General precautions for Outlook Express:
     
    Do not archive mail in the receipt or sent items box. Create your own user-defined folders and move messages you want to put in them. Empty the deleted items folder daily. Although the dbx files have a theoretical capacity of 2 GB, I recommend all a 300 MB max for less risk of corruption.
     
    Information on the maximum size of the .dbx files that are used by Outlook Express:
    http://support.Microsoft.com/?kbid=903095
     
    Disable analysis in your e-mail anti-virus program. It is a redundant layer of protection that devours the CPUs, slows down sending and receiving and causes a multitude of problems such as time-outs, account setting changes and has even been responsible for the loss of messages. Your up-to-date A / V program will continue to protect you sufficiently. For more information, see:
    http://www.oehelp.com/OETips.aspx#3 
     
    Why you don't need your anti-virus to scan your email
    http://thundercloud.NET/infoave/tutorials/email-scanning/index.htm
     
    Note that for some AV programs, it may be necessary to uninstall the program and reinstall in custom Mode and uncheck analysis when the option is the result of e-mail messages.
     
    Compact often as specified above.
     
    And backup often.
     
    Outlook Express Quick Backup (OEQB Freeware)
    http://www.oehelp.com/OEBackup/default.aspx 
  • I get an Error Message When you try to send emails. "some errors occurred while processing the requested tasks. Please see the list of errors below for more details". __

    I get an Error Message When you try to send emails. "some errors occurred while processing the requested tasks. Please see the list of errors below for more details".

    But it sends the message anyway... multiple copies, and she also is put in the "Outbox" in Outlook Express as if it is not sent.

    To stop the email to be sent repeatedly to the recipient, I erase it from the "Outbox" but a) you don't know if they really got it) b it is embarrassing for the receiver c) is this a bug I can fix it?

    Thanks for any help.

    You have a corruption of dbx file easily corrected.

    Spend most of your messages out of the Inbox and then create new folders to send and sent items box after having moved the messages you want to save to a local folder that you create.

    Tools | Options | Maintenance | Store folder will reveal the location of your Outlook Express files. Note the location and navigate on it in Explorer Windows or, copy and paste in start | Run.

    In Windows XP, Win2K & Win2K3 the OE user files (DBX and WAB) are by default marked as hidden. To view these files in Windows Explorer, you must enable Show hidden files and folders under start | Control Panel | Folder Options icon | Opinion, or in Windows Explorer. Tools | Folder options | View.

    With OE closed, find the DBX files for the items in the Outbox and sent and delete them.  New ones will be created automatically when you open OE.

    After you're done, followed by compacting your folders manually while working * off * and do it often.

    Click Outlook Express at the top of the the folder tree so no folders are open. Then: File | Work offline (or double-click on work online in the status bar). File | Folder | Compact all folders. Don't touch anything until the compacting is completed.

    General precautions for Outlook Express:

    Do not archive mail in the receipt or sent items box. Create your own user-defined folders and move messages you want to put in them. Empty the deleted items folder daily. Although the dbx files have a theoretical capacity of 2 GB, I recommend all a 300 MB max for less risk of corruption.

    Information on the maximum size of the .dbx files that are used by Outlook Express:
    http://support.Microsoft.com/?kbid=903095

    Disable analysis in your e-mail anti-virus program. It is a redundant layer of protection that devours the CPUs, slows down sending and receiving and causes a multitude of problems such as time-outs, account setting changes and has even been responsible for the loss of messages. Your up-to-date A / V program will continue to protect you sufficiently. For more information, see:
    http://www.oehelp.com/OETips.aspx#3

    Why you don't need your anti-virus to scan your email
    http://thundercloud.NET/infoave/tutorials/email-scanning/index.htm

    Note that for some AV programs, it may be necessary to uninstall the program and reinstall in custom Mode and uncheck analysis when the option is the result of e-mail messages.

    Compact often as specified above.

    And backup often.

    Outlook Express Quick Backup (OEQB Freeware)
    http://www.oehelp.com/OEBackup/default.aspx

    Bruce Hagen
    MS - MVP October 1, 2004 ~ September 30, 2010
    Imperial Beach, CA

Maybe you are looking for

  • How can I remove an old Apple ID?

    Hello I would like to change the current Apple ID with an e-mail address that is used by a former Apple ID that I have. I logged on my old Apple ID to try to remove it so that I can use the e-mail address in my class, but I can't understand how to re

  • Can delete you an album and the photos it contains in a single operation?

    It is a rare event, but I have a hierarchy 3 about 3 levels of depth of folders and albums containing photos I would like to delete from the folder in the foreground and an iteration completely to the lower level and all folders, albums and pictures

  • Qosmio G20-127: after that Windows update I can not see list fax and printer

    Description of the problemModel: Toshiba Qosmio G20-127Operating Sysytem: Microsoft Windows Media Center Edition After the restoration of BONE of restore DVD, I can see list Fax and printer. But after the Windows Update I can not see the list of fax

  • Satellite C660/C660D - Webcam does not work

    I recently got the Toshiba satellite c660/c660D laptop for my 21st birthday in July. It is said there is a built-in webcam, but I can't see it or find it. Also when I try to use videoconferencing on Skype, he said that it is not important which web c

  • Question about the parental control in the modem x 3500

    Hello How can control the time of the evening evening from time to time Example of The time from 16:00 to 20:00 COMPO box the night of time, there is no option for the evening of time Please help me