Filter objects of a collection of duplicate objects

I am running a report that lists the created virtual machines based on the event logs.  If the initial supply fails, the virtual machine is removed and recreated with the same name.  The report shows these VMs twice instead of once.  How can I remove objects in double vm of the release of the report?   If the VM names are the same, and they are not in different vCenters, whereas they are duplicates.

Thank you!

$start =(Get-Date). AddDays(-7)

$finish =(Get-date) .adddays (0)

$report = get-VIEventPlus-start $start - finishing $finish |

Where-Object {"VmCreatedEvent", "VmClonedEvent", "VmDeployedEvent" - contains $_.} GetType(). Name} | %{

$evtThisNewVMEvent = $_

Try {}

$vm = get-VM-Id $_. Vm.VM - ErrorAction Stop

}

Catch {}

return

}

$vm | Select @{N = 'The virtual computer name'; {E = {$_.name}},

@{N = "vCenter Server"; E={$_. "Uid.Split(":") [0]." {{Split("@") [1]}},

@{N = "Createduserid"; {E = {$evtThisNewVMEvent.createdTime}}.

@{N = "created by";} {E = {$evtThisNewVMEvent.UserName}},

} | Sort-Object Createduserid

$report | report.csv - notypeinformation - useculture csv export

Yes, you could make a

Tri-objet-unique VMID

Tags: VMware

Similar Questions

  • CS6 Master collection LOCKED DUPLICATE

    Hello

    There is no way to engage in a live chat through your Web site I have to write this instead. I bought the Master collection in 2012 - why not not creative cloud recognizes this fact? How do we install the products? I did not initial the cs6 facilities - why the customer should deal with all this and why Adobe doesn't it automatically?

    Despite all the questions, I just need to get active software thanks all... Please advise

    Felix

    Go to CS6 Master collection - Cloud

    Hello

    Please contact adobe support:

    Contact the customer service

    * Be sure to stay connected with your Adobe ID before accessing the link above *.

  • Export of objects of the inventory of VC to CSV files

    Can someone help me develop the following script? I would create five CSV files, one file for each of the following objects in a VC inventory specified:

    1. data centers - name, location (e.g., the children of a folder / root?)

    2. cluster - name, location (e.g., the children of a folder / data center?), DRS enabled?, DRS, HA mode?

    3. records - name, location (e.g., the children of a folder / data center / root?)

    4. host - name, location (e.g., the children of a folder / data center?), clustered?

    5. resource Pools - name, location (e.g., children of a cluster / resource pool), information sharing

    This will be useful for a "backup" of the inventory of VC human readable.

    I tried to use Get-inventory but have problems with collecting the parent / child relationships and filter objects by default (for example, root data center, resource pool "resources", etc.)

    Any help is appreciated. Thank you.

    Take a look at this document.

    Contains export and import functions

    http://communities.VMware.com/docs/doc-12182

    -

  • How to filter messages simpleChat (private chat)

    So I tried to find a solution, but after several hours, I can not find how do.

    My use case:

    There is a single host for a room. Others in the room can speak to the host, and users can see their private chat with the host. Users can see the chat component only when the host is connected.

    The host uses another application in which he can see the list of users who speak of him. It can select a user from the list, and he sees a simple conversation with only messages between him and the selected user.

    What I finished (I think it may help others in the future and maybe, there is better way to do):

    * In the user application: use the userManager your ConnectSessionContainer property. There an arrayCollection named collection hostCollection on hosts that are currently connected.

    In my case, I put the components of cat in a container and use a link visible property:

    visible = "{connectSession.userManager.hostCollection.Length > 0} '"

    You can also add an event listener for the userManager and listen to UserEvent.USER_CREATE and USER_REMOVE and check if event.userDescriptor.role == 100 or again controlled the hostCollection.length of the userManager.

    * If you simpleClass of subclass, you can access the _toCombo which is the drop-down list of the chat area.

    You can set its visible to false and set its selectedItem property on the first object of its dataprovider whose role is equal to 100 in order to force the cat to be private with the host.

    * In the host application, you can create a list using the ConnectSessionContainer.userManager.audienceCollection as a dataProvider for a list of users.

    It is easy to set the combobox control to simple to talk only to the selected user conversation, but what I have not been able to do is to filter history to only show that the conversation with the selected user and no other messages, without creating several rooms.

    I looked in the source code, but the historic property of the simpleChatModel is just a string and do not find an easy way to filter.

    I was looking for an arrayCollection collection nodes in the history, because I could use the filter property of the collection, but I did not find.

    So, where should I look for, and what is the best way to filter history using the recipient_Id?

    Thank you for your help...

    Sorry for the long post, but maybe this will help someone in the future...

    Hello

    What other parts you have been doing is perfectly fine. So, I think on

    on the side of the host you want to filter so that when a host, you select one

    user and click on it, it should show only chat between this user and

    the host.

    Although there is no direct way that by default, show us all messages to the

    realized a user cat, but again I can give some advice.

    What you need to do is change the method of formatMessageDescriptor

    SimpleChatDescriptor or subsclass it.

    Try to maybe add another parameter to this function as

    public void

    formatMessageDescriptor(p_msgDesc:ChatMessageDescriptor,p_targetedUserID:String=null):Stri ng

    and when you create an object of SimpleChat, ensure that in calls to

    This method, you pass somehow user ID only the user that you want to

    See messages with. In a more general way, this setting may take a

    array that contains only users whose desired cat IDs

    for display in a window.

    Inside the function, make sure that filter you to do something

    Like this

    If (p_msgDesc.recipientID == p_targetedUserID) {}

    you would add these messages

    } else {}

    do nothing to make the message back «»

    }

    If you use a table of targetedUserIDs, then a check of the loop if

    He allied himself with the recipientID and if so, adds this message.

    It should work in your case. We are planning a complete overhaul of cat

    in the future (period of next year), at that time there I'll definitely keep

    your suggestion of the spirit.

    Let me know if it works for you.

    Thank you

    Hironmay Basu

  • Essbase filter backup/restore

    Hi all

    Apologize if this has already been answered, but had a question about the filters you want to better understand how to restore...

    We are on 11.1.2.1 and take a nightly export of LCM of all applications and objects. I observe that the individual filters are under 'Security' of all the applications folder. We also export Essbase.SEC in a readable using Maxl text file. I know that filter info is stored in the. S file, but if something goes wrong and say, Filter1 of App1 is corrupted, are we supposed to review the security-readable text file and re-create the filter via Maxl under the procedure to "restore"?

    What is the purpose of the filter object in the backup of LCM?

    Thank you!

    If you have a snippet of LCM of security filters, you should be able to import them, the usual problem with filters of LCM are they are not the best in their assignment, even if the user/group is correct in export, in any case, you have everything that you need to be able to restore and if it does not work Maxl is too.

    See you soon

    John

  • The anti-aliasing filter selection

    Deal Sir

    I want to choose the anti-aliasing filter. I data collection in real time of current through NI Mseries 6281 DAQ probe. My sampling rate is 8 kHz and Total number of samples 40 k. What is the value of the frequency, should I choose for the anti-aliasing filter?

    Deep eyes

    Automata

    Yes. That should be fine.

    Lynn

  • Lightroom 4 collections of deleted - photo remain fooled

    Hi chaps - I was messing around with the web module and have created several "collections" to test several ideas, LR has created duplicates for all distinct collections, I'm now at the stage where I decided what to do if you want to remove all duplicates in "All photos", but I thought that if I deleted 'collection' Associates duplicates would disappear, but they are still there I would prefer not to have to go through them all manually... advice please?

    Regards Roger

    It seems that you told Lightroom (perhaps accidentally) to make virtual copies when adding to the collections. If you plan on this again in the future, simply turn this option, and then when you remove it from the collection, you will not have the "duplicates".

  • Photos with indicator not no projection in all of the main Collection

    I've set up a collection in LR, set several subsets below. However, for some reason, one of the sub sets does not show marked photos in all of the main collection. I see pictures with other sets of void indicator, and when I go on the individual games in the wandering sub defined the show of flags, but they are not 'communicate' to the whole collection, or even the game do.

    To better illustrate graphically:

    All of the main Collection
    Whole collection
    Pictures a
    Photos b
    Collection series B
    Photos 1
    Photos 2

    All photos marked in the series Collection B (Photos 1 and 2) occur when I filter flag in hand Collection Set, but none of the photos under Collection Set A flag are, i.e. pictures spotted in Photos collections and b pictures don't get shown when I click on hand Collection Set and filter to flag.

    In addition, even when I click on filter to flag and Collection Set A, it returns 0 photos.

    Something is strange here, and I can't understand it. Anyone has any ideas that can help?

    Wouldn't be easier to use signage, but something that spans folders and collections, such as stars or color labels.

    This is one of the consequences of the much loved/hated location of flags and one of the reasons why I don't use no flags at all.

    Awkward work around this problem, you can filter on the flags in the Sub-collection eachj, select all images, go to display all photographs and reapply the flags. "All photos" refers to the display of folders (and the collection smart view, seen together the collection) with respect to the signage goes.

    Beat

  • Different "views" of the same collection of ArrayCollection

    Hello

    How would be the best way to do this?

    I'm going to simpify the problem, so it's quite fictitious...

    Let's say I have a class, student:

    public class student

    {

    public var name: String;

    public var isActive:Boolean;

    public var averageGrade:int; 0 = 1 A = 2 B = C, 3 = D (or other)

    public var likesCabbage:Boolean;

    }

    I have a collection of all students in my school, called allStudents ArrayCollection.

    Now, I want to display on a single screen, several views of this collection ArrayCollection:

    1. all students (IE not filtered)

    2. students where isActive = true;

    3. students with an average grade of B or above

    4. students who like cabbage.

    Obviously, if I simply apply a filter to the collection ArrayCollection, it will have an impact on all of these points of view. So I need basically a filter that is limited to each component.

    I could copy the ArrayCollection collection four times (a loop in the original and using addItem() to add each item to the new collections, so that they are not related) and apply a filter to each new collection, but this seems messy - and among other problems, the ArrayCollections news will not be linked to the original, so if this changes, others will not automatically be updated.

    Is there a best practice for this situation?

    Thank you!

    ListCollectionView is your friend!

    var unfiltered: ListCollectionView = new ListCollectionView (mySourceAC.list);

    var active: ListCollectionView = new ListCollectionView (mySourceAC.list);

    active. FilterFunction = activeFilterFunction;

    class var: ListCollectionView = new ListCollectionView (mySourceAC.list);

    graded.filterFunction = gradedFilterfunction;

    Points of view all the wrap the same source so you only have to update that.

    You may have to monkey with refresh() sometimes, but that's a small price to pay!

  • No photos of collection?

    In the Panel collections, I have a collection that shows 53 photos included.  When I select this collection the message I get

    is "no pictures in the selected collection.  I really want to go back through my photos and create this collection once again.  Is

    It is a way to solve this problem?  Thank you

    You probably have a filter selected for this collection. Look at the top of the grid view, and turn it off.

    HAL

  • Several filters for a unique Collection?

    Hello

    This has probably been covered in detail.  If so, please tell me, because I was not able to find it.

    What is the best way to display several multiple filtered views of a collection in MXML?  The problem I face, is that you can't apply filters to repeaters, lists, etc. However, if you apply only a single filter directly to the collection.

    Let's say I have a collection of "vehicles" and I want two grids of data based on this unique collection.  A data grid displays only the trucks and the other shows, only cars.  What would be the best way to do this in MXML * with * binding?  If I add a car to my collection, so I want this new car automatically appears in the cars, not trucks grid grid, etc.

    This one has been dogging me for awhile.  Maybe there's a simple solution?

    Thank you!

    There is!

    Keep your original collection, call the vehicles.

    Then wrap your collection in two different ListCollectionViews

    i.e.

    var car: ListCollectionView = new ListCollectionView (vehicles);

    var vans: ListCollectionView = new ListCollectionView (vehicles);

    Now, you can sort and filter the cars and vans separately without any of the original collection.

  • collection is unique

    I set "i_gen_terms_list", defined as follows:
    --Type:
    create or replace
    type T_ID_ARRAY as table of NUMBER(10);
    
    --Parameter of Type:
    i_gen_terms_list     in    T_ID_ARRAY;
    It contains values from table GEN_TERMS of the ID column.
    What is the most effective way to determine if the "i_gen_terms_list" collection contains some ID - s more than once?

    The algorithm is:

    (1) if "i_gen_terms_list" has at least one element in several positions, then return false, otherwise return true.
    For example if i_gen_terms_list = {2,3} then algorithm should return true, because the elements of the collection are unique.
    For example if i_gen_terms_list = {2.3.2} then algorithm should return false, because the items in the collection were not unique, element '2' there are more than 1 time.
    For example if i_gen_terms_list = {}, then the algorithm must return true, because the collection is empty, so it has a unique content.

    It would be perfect to use the fastest solution for this.

    Following code is understandable to me, perhaps using this would give best solution:
    in (select column_value from table(i_gen_terms_list))
    Maybe the best way is to join intelligently givel last code with GEN_TERMS table? Or is the preferable plsql loop to determine uniqueness?

    Are you looking for this?

    scott@ORCL>
    scott@ORCL>select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    
    Elapsed: 00:00:00.00
    scott@ORCL>
    scott@ORCL>
    scott@ORCL>CREATE TYPE NUMBER_LST AS TABLE OF NUMBER(10);
      2  /
    
    Type created.
    
    Elapsed: 00:00:00.07
    scott@ORCL>
    scott@ORCL>
    scott@ORCL>DECLARE
      2    num_array NUMBER_LST := NUMBER_LST(1,2,3,4);
      3  BEGIN
      4     IF num_array IS A SET THEN
      5        DBMS_OUTPUT.PUT_LINE('No duplicates found');
      6     ELSE
      7        DBMS_OUTPUT.PUT_LINE('Collection contains duplicates');
      8     END IF;
      9  END;
     10  /
    No duplicates found
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.04
    scott@ORCL>
    scott@ORCL>DECLARE
      2    num_array NUMBER_LST := NUMBER_LST(1,1,3,4);
      3  BEGIN
      4     IF num_array IS A SET THEN
      5        DBMS_OUTPUT.PUT_LINE('No duplicates found');
      6     ELSE
      7        DBMS_OUTPUT.PUT_LINE('Collection contains duplicates');
      8     END IF;
      9  END;
     10  /
    Collection contains duplicates
    
    PL/SQL procedure successfully completed.
    
    Elapsed: 00:00:00.00
    scott@ORCL>
    scott@ORCL>
    

    Kind regards.

    LOULOU.

  • Help with loop of Liquid web app

    Hello

    I need help with a list of web app for a custom blog items.  Rather than having to categorize each post using the 'Actions' box (which they often forget), I think it would be much more user-friendly for our customers to have just a dropdown categories menu.  Can someone help out me this code, or to provide a more elegant solution?  The loop and the work of IF statement, but I'm having problems with rendering of the element in the IF statement.  When I copy the code of the object model in the IF statement, it restores.  However, I had much rather use a template because it is better - and I would like to know what I'm doing wrong.

    {module_webapps id = filter 'Blog' = 'all' render = "collection" collection = "messages" sortType = 'date' template =""}
    {% for section in posts.items %}
    {% If item.category contains 'Food' %}
    {module_webapps id = filter 'Blog' = 'item' itemID = "{{item.itemid}}" template="/Layouts/WebApps/Blog/list.html" "}
    {% endif %}

    {% endfor %}

    Thank you!

    Jeff

    Hi Jeff, what's going to happen with what you do is your make a collection of all the web of elements app and if you match foods your rendering module of a single element.

    First of all who will soon use your deduction limit to 75 module upward on this page/model until you know.
    Second, think about why you need to make the module again? You have the item data because you can get the itemid, then why you not only made the rest?

    Finally...

    If you make collection = "" which means that you use the collection that you have you don't need not make = 'collection. " "If you have deleted the template =" "and collection =" ' make = 'collection' means that it will be available in your layout to the list as a collection, rather then one.

  • PowerCLI Script to the report on the failed VM jobs

    I figured out how to report on the events of VM (get-vievent), but no has no stains of VM. If a snapshot of the virtual computer fails, sometimes it never connect the events of the VM, but lists an error on the display of tasks. We are trying to monitor the clichés failed since its part of our backup solution.

    I was looking for a way to report these tasks/failure of events in a daily report, or simply add to the daily report of amazing Alan Renouf that we use.

    does anyone have any suggestions? For an example, see the attached screenshots. See how, in the view tasks, you have mistakes, but in the view of events, there is no errors.

    Any help would be great. Thank you!

    Jeff

    PowerCLI Script to the report on the failed VM jobs

    I figured out how to report on the events of VM (get-vievent), but no has no stains of VM. If a snapshot of the virtual computer fails, sometimes it never connect the events of the VM, but lists an error on the display of tasks. We are trying to monitor the clichés failed since its part of our backup solution.

    I was looking for a way to report these tasks/failure of events in a daily report, or simply add to the daily report of amazing Alan Renouf that we use.

    does anyone have any suggestions? For an example, see the attached screenshots. See how, in the view tasks, you have mistakes, but in the view of events, there is no errors.

    Any help would be great. Thank you!

    Jeff

    Hi Jeff

    I had exactly the same need to identify stereotypes having failed and drilled until SDK and LucD suggestions (thank you) to encode the following lines:

    $vmlist = Get-VM |sort Name
    
    foreach ($guestname in $vmlist)
    {
        $hours = 48 # Number of hours back
          $tasknumber = 999          # Windowsize of the Task collector
    $taskMgr = Get-View TaskManager
    
    # Create hash table. Each entry is a create snapshot task
    $report = @{}
    
    $filter = New-Object VMware.Vim.TaskFilterSpec
    $filter.Time = New-Object VMware.Vim.TaskFilterSpecByTime
    $filter.Time.beginTime = (Get-Date).AddHours(-$hours)
    $filter.Time.timeType = "startedTime"
    
    $collectionImpl = Get-View ($taskMgr.CreateCollectorForTasks($filter))
    
    $dummy = $collectionImpl.RewindCollector
    $collection = $collectionImpl.ReadNextTasks($tasknumber)
    while($collection -ne $null){
    $collection | where {$_.DescriptionId -eq "VirtualMachine.createSnapshot" -and $_.EntityName -eq $guestName} | %{
    if ($_.State -eq "Error") {
            write-host $_.EntityName
            write-host $_.StartTime
            write-host $_.State
            }
        else {
        }
    }
    $collection = $collectionImpl.ReadNextTasks($tasknumber)
    }
    $collectionImpl.DestroyCollector()
    
     }  
    

    This script displays the name of the virtual machines which met with an instant failure in the last 48 hours (a variable, you can change)

    This is just the beginning, because I want to count the shots failed and identify virtual computers that have more than 2 in 2 days

    Feel free to alter it at will.

    Enjoy

    Eric

  • IDCS6 MACOSX JS: script of 'remove unused layer' is not from masters of the masters

    Hello everyone.

    I have an old script I've used several times to remove the unused layers. Until today, I thought that worked well:

    var layers = app.documents[0].layers.everyItem().getElements();
    for(var i=layers.length-1;i>=0;i--){
      if(layers[i].pageItems.length==0){
        layers[i].remove();
      }
    }
    

    However, today, I used the script on a document that was a never used layer once on a master page to which other master pages have taken place on the basis. To my surprise, when the script is run, this specific layer has been removed.

    my knowledge of the script is poor, but looking at the script, it seems that the script is looking at all the layers that have something in them and any layer comprising any element should be removed. However, I think that only made pageItems refers to the regular pages or template, not masters BASED ON other masters.

    I think that the problem is similar to another that I had recently where I had a script that has removed the unused masters, but deleted that other masters masters took place on the basis, and I think that the principles are the same. This thread can be found at:

    http://forums.Adobe.com/message/5922004#5922004

    In short, the script that worked there were as follows:

    xUnusedMasters(myDoc);
    
    function xUnusedMasters( docRef ) {
    var mpNames = new Object () ;
    var allPages = docRef.pages ;
    for ( var pIndex = allPages.length - 1 ; pIndex >= 0 ; pIndex-- ) {
    mpNames = addMasterName ( mpNames , allPages[pIndex] ) ;
    }
    
    var allMasterPages = docRef.masterSpreads ;
    for ( var mpIndex = allMasterPages.length - 1 ; mpIndex >= 0 ; mpIndex-- ) {
    if ( ! mpNames[allMasterPages[mpIndex].name] ) {
    allMasterPages[mpIndex].remove() ;
    }
    }
    return ; 
    
    function addMasterName ( MPDB , pageRef ) {
    if ( pageRef == null ) { return MPDB ; }
    if ( pageRef.constructor.name == 'MasterSpread' ) {
    MPDB[pageRef.name] = true ;
    }
    return addMasterName ( MPDB , pageRef.appliedMaster ) ;
    }
    }
    

    is it possible to modify the script above so that instead of remove unused pages of masters, it takes away the layers used in a similar way?

    Thank you very much

    Colly

    Hello

    Maybe a little differently...:

    Array.prototype.filter = function(collection) {
              var k, i, con, ids = collection.everyItem().id;
              con: for (k = ids.length - 1; k >=0; k--)
                        for (i = 0; i < this.length; i++)
                        if (this[i].id == ids[k]) {
                             ids.splice(k, 1);
                             continue con;
                             }
              return ids;     // array with unmatched ids from collection
              }
    
    var
              mL = app.activeDocument.pageItems.everyItem().itemLayer,
              mUnusedLayersID = mL.filter(app.activeDocument.layers),
              len = mUnusedLayersID.length;
    
    while (len-->0)
              app.activeDocument.layers.itemByID(mUnusedLayersID[len]).remove();
    

    mL is a table with a layer of each pageItem;

    filter compared to the collections of doc.layers;

    unmatched ways not so used are deleted.

    Jarek

Maybe you are looking for