Custom attributes / warehouses of data in reports

If that's the answer somewhere if I apologize, I have watched honest

I want to find a method to get a report of my virtual machines, similar to the csv/excel doc, you can buy just to make a list of a host/vcenter export. However, I also wanted to include in this list the store of data/s(not LUNs) these virtual machines are connected to.

From what I can tell and I'm not an expert, it is not a simple way to have a custom 'fill' attribute or automatically generate this type of information. I'm fairly certain that at least must be an easy way to do something like that but, I don't know how. Also, I thought it could be very easy to do with powercli, however, of course I don't know how to do it.

If someone could help, I would be very happy.

Hello, @CRad14-

I see that there are some examples in the localities.  An example to collect a few items of information VM: http://communities.vmware.com/message/897743#897743

An example which returns many more info VM: http://communities.vmware.com/message/1516767

The other apparently handling the request you have.

Enjoy

Tags: VMware

Similar Questions

  • Create a custom attribute to model the growth rate of the data store used space

    I would like to see data warehouses are growing fastest of the environment in terms of GB per day or something similar.  Is it possible to use a custom attribute to apply a formula that measures the rate of growth of a store of data over time, which allows me to see what data stores fastest?

    You would look for an average simple mobile for a SM you describe. vC Ops does not simple moving average formulas for SMs at this time.

    Looks like you are looking for a "growth rate", but you really won't get it with the built-in attributes. You might look differently and look at the remaining capacity and the remaining time metric. Also, you could create additional widgets to view graphs of util % over the last 30-90 days to give a better picture of usage in GB, #VMs, etc.

    I also suggest to make a Top - N showing use the lowest of the remaining time metric and the remaining ability... This will give you your data warehouses that are more at risk.

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

  • Update custom attributes - additional Note fields

    I tear my head off with getting a script works, maybe

    You can help

    I'm looking to see if a custom on all machines attribute is

    populated. If not then I would like to fill

    I can't seem to find the way out of the value of the

    attribute.

    The idea of the script would be to review all the VMS on a daily basis - see

    If they are populated with the field "date installation" – if not.

    means that they have been created in the past day. I would check if this field is

    filled, if not, get the date of creation of AD and fill and if the

    the machine is not windows, fill in the date of the day.

    This way I can also follow the old VM's to see if they are still

    necessary.

    Of course also allows to add to a report of all VM

    created by day and many other uses.

    I think it's in the note field

    Thanks a bunch

    Join the code here...

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

    This script will scan all the vm to check if the "Date installation" field has a value. Otherwise it will be the Active Directory query for the computer account creation date

    and fill in the field. If the information is not present in AD, then it will set the value for today's date

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

    $folder = Read-Host "Please enter the name of the folder:

    $tgtName = "date of installation.

    $today = Get-Date -uformat '% d/%m/%Y '.

    Get-file $folder | Get-VM | ForEach-Object {

    $cdate = Get-QADComputer -name $_. Name

    $vmid = (Get-view $_.ID)

    foreach ($fld in $vmid. Availablefield)

    {

    If ($fld. {Name - eq $tgtName)}

    $tgt = $fld. Key

    }

    foreach ($val in $vm. CustomValue) {}

    If ($val. Key - eq $tgt) {}

    If ($val. Value - eq "") {}

    If ($cdate - eq "") {}

    Get-vm $_. Name | Set-CustomField -name 'Date '.

    Installed" -value $today

    }

    Else {}

    $convertDate = $cdate.whencreated

    Get-vm $_. Name | Set-CustomField -name 'Date '.

    {Installed" -value $convertDate.ToShortDateString ()}

    }

    }

    }

    }

    }

    Thanks in advance...

    Maish

    Director systems & virtualization architect

    http://technodrone.blogspot.com

    The script below should do what you want.

    A few notes:

    • the logic to get the date of installation for Windows and Linux clients has been moved to a separate function

    • to cover all possibilities that I used 2 flags ($tgt and $found). According to these flags the custom attribute will be left alone, created or updated to date.

    • using the cmdlet Get-QADComputer requires the presence of the snap of the Quest.ActiveRoles.ADManagement.

    function Get-DateInstalled($VMname){
         $ADcomp = Get-QADComputer -Name $_.Name
         if($ADcomp -ne $null){
              $convertDate = $ADcomp.whencreated.ToShortDateString()
              return $convertDate
         }
         else{
              $today = Get-Date -uformat "%d/%m/%Y"
              return $today
         }
    }
    
    $folder = "POC"
    $tgtName = "Date Installed"
    $today = Get-Date -uformat "%d/%m/%Y"
    
    Get-Datacenter "ENG" | Get-Folder $folder | Get-VM | ForEach-Object {
         $vmid = (Get-View $_.ID)
         $tgt = (-1)
         foreach ($fld in $vmid.Availablefield) {
              if ($fld.Name -eq $tgtName) {
                   $tgt = $fld.Key
              }
         }
    
         $found = (-1)
         # "Date Installed" found
         if($tgt -ne (-1)){
              # Custom values present
              if($vmid.CustomValue -ne $null){
                   foreach($val in $vmid.CustomValue){
                        if($val.Key -eq $tgt){
                             $found = $val.Value
                        }
                   }
              }
         }
         if($found -eq (-1)){
              if($tgt -ne (-1)){
                   Get-VM $_.Name | Set-CustomField -name "Date Installed" -value (Get-DateInstalled $_.Name)
              }
              else{
                   Get-VM $_.Name | New-CustomField -name "Date Installed" -value (Get-DateInstalled $_.Name)
              }
         }
    }
    
  • 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-

  • 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})

  • Add current VM to custom attribute datastore

    I am trying to find a way to fill the custom attribute "Data store" with the name of the data store of the data store that the virtual machine is running. I want to achieve this by using the PowerCLI. We use vSphere 5.0. I tried to google for it, but I couldn't find a solution. Since I'm not very good in the script I could find a solution for me. Thanks for any help.

    CustomField cmdlets are obsolete (they disappear on the next versions ethe).

    Try it like this

    $ca = Get-CustomAttribute -Name Datastore -ErrorAction SilentlyContinue if(!$ca){
      $ca = New-CustomAttribute -Name Datastore -TargetType VirtualMachine}
    
    foreach($vm in Get-VM){
      Set-Annotation -Entity $vm -CustomAttribute $ca -Value (Get-Datastore -RelatedObject $vm | select -ExpandProperty Name)
    }
    
  • 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?

  • Script to list all the warehouses of data in a cluster, the virtual machines on the data store and the host of the virtual machine is on

    We have warehouses of data which are seen by more than one cluster. I need a script that will display:

    all stores of data seen by a cluster

    the virtual machines on the data store

    the host of the virtual machine is on

    the cluster the host is in

    The output I want is

    name of the store of data, the VM name, host name, the name of the Cluster

    any help would be appreciated

    Pretty sure this will do what you need:

    $report = @()
    Foreach($cluster in Get-Cluster){
        $datastores = $cluster | Get-VMHost | Get-Datastore
        foreach($datastore in $datastores){
        $vms = $datastore | Get-VM
        If ($vms.count -ge 1){
            foreach($VM in $vms){
            $object = New-Object -TypeName PSObject -Property @{
                  Datastore = $datastore.Name
                  VM = $VM.Name
                  HostName = $VM.VMhost
                  Cluster = $cluster
                }
            $report += $object
            }
    
        }
        }
    }
    $report | Export-Csv C:\Temp\VMs.csv -NoTypeInformation -UseCulture
    

    If you only want to shared data warehouses you can then use

    $datastores = $cluster | Get-VMHost | Get-Datastore | Where {$_.Extensiondata.Summary.MultipleHostAccess -eq $True}
    

    Hope this helps

  • How to write the field of custom attributes the end of the backup of the VM VM?

    Hello world

    I would like to know if it is possible to write about the attributes of custom field of VM or at least in the 'Notes' field after the virtual machine has been saved?
    I know that this question involves the combination of two parts that is knowledge of VMware, Powershell and maybe Windows Server as well?

    The message that must be written every day in the custom field attribute will be "last backup time DD/MM/YYYY '.

    I used to access this feature in Veeam Backup but not since I'm now on HP Data Protector (very old and primitive software) in my new business, I work for.

    Any help and advice would be appreciated.

    Thank you.

    Hello, AlbertWT-

    To set the value of the 'Notes' field, you can use the Set-VM cmdlet such as:

    Get-VM myVM | Set-VM -Description "Last backup time $(Get-Date -Format 'dd/MM/yyyy')" -Confirm:$false
    

    To set the value of a custom attribute, you can use the method "setCustomValue()" of .net machine virtual View object, as shown in the answer to the thread "defining annotations / fields customized directly through VM object". ""

    Message edited by mattboren: added links to the documentation

  • Get the custom attribute

    I am creating a report and I need to draw a custom attribute, user name and host name of vcenter.

    I use the following in Ecoshell

    Get - VM | Select name - ExpandProperty CustomFields | Where {$_.key - eq 'Client'}

    He gets me the name of the customer and the custom attribute 'Customer', but I don't know how to get the hostname of vcenter also in this same report. I have another command to extract the name of guets and vcenter name but I'm still learning and I'm not sure how to combine the two to get it as a report / outings, etc.

    See you soon,.

    Bradley sessions

    If you have found this or other useful information, please consider awarding points to 'Correct' or 'useful '.

    Must have misread, I'm sorry.

    Try this

    Get-VM -Server $defaultVIServers | Select Name, @{N="VCHost";E={($_ | Get-View).Client.ServiceUrl.Split("/")[2]}}, @{N="Attr";E={($_ | Get-Annotation | where {$_.Name -eq "Customer"}).Value}}
    

    Note that you first need to make a VIServer-connect to all your vCenters.

    All connected vCenters are in the $deaultVIServers variable.

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • Custom attributes not visible user on the user profile in OIM 11 g

    Hello

    As I have created a custom attribute in OIM11g. I'm not able to view the attribute after that I have the Fund a user to IOM.
    Please help me to solve my problem.

    Thank you
    Srikanth

    It's a very basic thing. Just trying to create a permission policy , and you know how to do it. For your reference, I am also paste the excerpt from Metalink Article

    After the creation of the UDF, please follow the steps below to make the visible UDF for editing by the user admin:
    1. navigate to create a new 'authorization Policy' as below:
    a. login to the user interface and click Administration
    b. at the top left, you'll see the authorization policy tab
    c. now, click on create a permission policy
    2. Please use the information to create the following permission policy
    a. name: policy of the UDF
    (b) name of the entity: user management
    c. Permissionsc. Permissions:
    i. edit user profile
    User profile of view II.
    Please ensure that the UDF is selected in the attributes of these permissions.
    d. data constraints: all users
    e. policy assignment: all users
    3. create a user called "useradmin" and add the below 2 roles: "."
    a. all users (this is default)
    b. identity user administrators (this will provide administrative support to this user tab so that it can administer other users)
    4. create another end user called "testuser1" people the necessary fields.
    5. now connect as "useradmin.
    6. search a user called "testuser1" and open the user.

  • Reg: Data in reports

    Hello

    I'm refreshing the data every night in ETL for obiee reports.but once the data is loaded into the data warehouse tables data are not get refreshed in the reports.either I have to update line count in RPD or clear cache to get the data updated in reports.are it all the parameters of the connection pool to refresh the data every day? What could be the reason


    Thank you

    Hello

    You must purge the cache once the data have been updated. There are several options to implement. See the messages below:

    How to clear the cache of all day automatically
    How do I purge the cache of daily
    Questions about the maintenance of the Cache of OBIEE

    Thank you

  • How to set custom attributes of Div in Adobe Edge?

    Hi all!

    I wonder if it is possible, staying in Adobe Edge animate, set custom attributes of a Div.

    For example, for the framework of the "Impress.js" presentation, we get this code:

    < div id = "large" class = 'step' data-x = '3500' data-y '2100' data-rotate = "180" data = "6" >

    < p > < b > Mar show grew up < /b > < span class = "thoughts" > idea </span > < / p >

    < / div >

    Thus, in EA, we can call a Div (but what kind of Div? A rectangle? A text box empty?) with the 'big', we can also add the shape to the 'step' of class user interface, but we cannot - as far as I know - insert custom attributes.

    Perhaps with Jquery 'setAttribute'?

    Thank you very much!


    Davide

    In my opinion, what they added or 'set' dynamically, as you might have guessed.

    This is an old thread on the same topic.

    Darrell

Maybe you are looking for