Automation

 View Only
  • 1.  list of vms created

    Posted Nov 15, 2010 12:17 PM

    Hi All,

    I was trying to use the script “who created the VM” .

    Unfortunately, all its shows is CreatedBy “unknown” and CreatedOn "Unknown" except for a bunch of machines.

    I have the guest AD commandlets installed and running. But all it shows is unknown. Any ideas/suggestions?

    Thanks,

    A



  • 2.  RE: list of vms created

    Posted Nov 15, 2010 12:26 PM

    Alan's script uses the Get-VIEvent cmdlet to find the entry for the creation of a guest.

    By default the cmdlet returns 100 most recent events.

    If your guests haven't been created recently, the VmCreatedEvent will not be found and the script will mark the user as 'Unknown'.

    To test, make a new guest and run the script again.

    For that recent guest you should see the custom attrbutes appear.

    ____________

    Blog: LucD notes

    Twitter: lucd22



  • 3.  RE: list of vms created

    Posted Nov 15, 2010 01:16 PM

    Agreed and absolutely understandable.

    As a query, is there any commandlet that can dig further deeper to look out for say, 1000 events or more. Also its not true for the case of "CreatedOn" . As the machine that shows "CreatedBy" - "username" still shows "CreatedOn" as unknown.

    Thanks again for your comments.



  • 4.  RE: list of vms created
    Best Answer

    Posted Nov 15, 2010 01:22 PM

    Yes, use the -MaxSamples parameter.

    Get-VIEvent -MaxSamples 1000
    

    or use the -Start and -Finish parameters to specify a specific time range (watch out, the cmdlet becomes a lot slower with a time range specified).

    The Created On works for me, are you using the script from the Who created that VM ? post ?

    ____________

    Blog: LucD notes

    Twitter: lucd22



  • 5.  RE: list of vms created

    Posted Nov 15, 2010 02:32 PM

    Adding max samples works like a charm. Can you guide me to a documentation for learning about these events and in depth stuff for power shell.

    Thanks and Regards

    A



  • 6.  RE: list of vms created

    Posted Nov 15, 2010 02:38 PM

    I have some posts on events.

    ____________

    Blog: LucD notes

    Twitter: lucd22