Creator of snapshot?

Hello

I create a report for snapshots using vCO 5.5, I want to go get name of creators of snapshot in the report, and I want to export the report to CSV format.

Please help me.

Thank you!!

Thank you!!

I used the same script, but get the error like "TypeError: cannot read property 'name' undefined (creator of workflow: snapshot / Scriptable task (item1) #6).

If please check and check and let me know if I'm doing something wrong.

Tags: VMware

Similar Questions

  • using snapshot script

    Most the script below for list of snapshots is spent for me (I made a few small changes) and it works fine except that it does not list the creator of the snapshot, but rather as the creator of the last snapshot even if there is not, instant vDP, for example.  In my opinion, it's how the Get-VIEvents is called instead to get the instant creator of the command get-snapshot.

    Is anyone able to point me in the right direction, or use another method to find the instant creator?

    Thank you.

    $myVMs = get - VM

    $VMsWithSnaps = @)

    {foreach ($vm to $myVMs)

    $vmView = $vm | Get-View

    If ($vmView.snapshot - not $null) {}

    $snapsize = get - vm $vm | Get-snapshot | Select @{N = "SizeMB"; E = {[Math]: tour ($_.)} SizeMb)}}

    $SnapshotEvents = get-VIEvent-body $vm - type info - MaxSamples 1000 | Where {}

    $_. FullFormattedMessage.contains ("Create virtual machine snapshot")}

    try {}

    $user = $SnapshotEvents [0]. Username

    $time = $SnapshotEvents [0]. Createduserid

    } catch {} [System.Exception]

    $user = $SnapshotEvents.UserName

    $time = $SnapshotEvents.CreatedTime

    }

    $VMInfo = "" | Select 'VM', 'CreationDate', 'User', 'SizeMb.

    $VMInfo. "" VM "= $vm. Name

    $VMInfo. "' CreationDate ' = $time

    $VMInfo. "" User "= $user

    $VMInfo. "" SizeMb ' = $snapsize. SizeMb

    $VMsWithSnaps += $VMInfo

    }

    }

    $VMsWithSnaps | Sort CreationDate | FT-auto

    After searching around on google, original screenplay seems to be:

    Find photos of the virtual machine with PowerCLI | A Sysadmin notes

    I've written a script before, which I'll post an article from below, makes you need TO get the name of the creator instant it involves using the API to get the saved task when the snapshot was created, (all times by obtaining the snapshot task of creating for the relevant VM within 5 seconds of the snapshot).  The script to see this section in context here is http://davotronic5000.co.uk/blog/updated-script-to-monitor-snapshots-in-vsphere/.  The part that gets the creators of snapshot is called:

    Write-Verbose"Getting list of Old Snapshots"

       $OldSnapshotList= $SnapshotList | Where {$_.Created-LE(Get-Date).AddDays(-$AlertOlderThan)}

       IF($OldSnapshotList-ne$null)

           {

           Write-Verbose"Getting Additional Snapshot Details"

           #Open report array

           $Report= @()

           $SnapUser= ""

           FOREACH ($Snapshot in $OldSnapshotList)

               {

               #Use Task log SDK to get the user who created the Snapshot

               $TaskMgr = Get-View TaskManager

               $TaskNumber = 100

               #Create task filter for search

               $Filter = New-Object VMware.Vim.TaskFilterSpec

               $Filter.Time = New-Object VMware.Vim.TaskFilterSpecByTime

               $Filter.Time.beginTime = ((($Snapshot.Created).AddSeconds(-5)).ToUniversalTime())

               $Filter.Time.timeType = "startedTime"

               $Filter.Time.EndTime = ((($Snapshot.Created).AddSeconds(5)).ToUniversalTime())

               $Filter.State = "success"

               $Filter.Entity = New-Object VMware.Vim.TaskFilterSpecByEntity

               $Filter.Entity.recursion = "self"

               $Filter.Entity.entity = (Get-Vm -Name $Snapshot.VM.Name).Extensiondata.MoRef

               $TaskCollector = Get-View ($TaskMgr.CreateCollectorForTasks($Filter))

               $TaskCollector.RewindCollector | Out-Null

               $Tasks = $TaskCollector.ReadNextTasks($TaskNumber)

                   #Get only the task for the snapshot in question and out put the username of the snapshot creator

                   FOREACH ($Task in $Tasks)

                       {

                       $GuestName = $Snapshot.VM

                       $Task = $Task | where {$_.DescriptionId -eq "VirtualMachine.createSnapshot" -and $_.State -eq "success" -and $_.EntityName -eq $GuestName}                         

                       IF ($Task -ne $null)

                           {

                           $SnapUser = $Task

                           }

                       $TaskCollector.ReadNextTasks($TaskNumber)

                       }

                   #Create a custom object for reporting

                   $objReport = New-Object System.Object

                   $objReport | Add-Member -Type NoteProperty -Name "Name" -Value $Snapshot.Name

                   $objReport | Add-Member -Type NoteProperty -Name "Description" -Value $Snapshot.Description                

                   $objReport | Add-Member -Type NoteProperty -Name "Created By" -Value $SnapUser.Reason.Username

                   $objReport | Add-Member -Type NoteProperty -Name "Attached To" -Value $Snapshot.VM

                   $objReport | Add-Member -Type NoteProperty -Name "Created On" -Value $Snapshot.Created

                   $Report += $objReport

               #There is a default limit of 32 collector objects, destroying collector after use

               $TaskCollector.DestroyCollector()

               }

  • Report snapshot including Snap owner/creator

    I have a script that I run every day to declare open shadow.  This is a script I found online, but then realized that we wanted to add the owner for the wink to the information.  Again, I found little code online and was able to add in the script, but he still does not seem to properly make the owner.  Any help would be greatly appreciated.

    Here is the corresponding code.  I added some parts that enter data using Get-VIEvent and then post it in (Description and CreatedBy).  The problem is that it doesn't seem to be reliable.  The owner sometimes comes in white, and sometimes it shows one user other than who actually took the snapshot.  I'm not great PowerShell and I wanted to know if someone can suggest what is wrong in the code?  I'll also join the original inside code that is supposed to shoot instant owner that I joined the first script.  When I run which, in itself, he either said the event is not in the database, or sometimes it is correct when the main script is wrong, or watch a user empty.

    I also read that there is a more reliable than VIEvents way to get the owner of the hanging.  I found a code on this forum, but I was unable to understand how to integrate properly.

    # Add plugin VMWare PowerShell and connect to vCenter

    Add-pssnapin VMware.VimAutomation.Core

    Set-executionpolicy remotesigned - confirm: $false

    Game-PowerCLIConfiguration - ignore InvalidCertificateAction - confirm: $false

    to connect-viserver < viserver >

    # create table to capture info VM snapshot

    $vmtable = New-Object system. Data.DataTable "VMTable".

    $col1 = New-Object system. Data.DataColumn VM, ([string])

    $col2 = New-Object system. Data.DataColumn Snapshot ([string])

    $col3 = New-Object system. Data.DataColumn SizeMB, ([string])

    $col4 = New-Object system. Data.DataColumn Created, ([string])

    $col5 = New-Object system. Data.DataColumn Description,([string]) #Added by me

    $col6 = New-Object system. CreatedBy,([string]) #Added by me Data.DataColumn

    $vmtable.columns.add ($col1)

    $vmtable.columns.add ($col2)

    $vmtable.columns.add ($col3)

    $vmtable.columns.add ($col4)

    $vmtable.columns.add ($col5) #Added by me

    $vmtable.columns.add ($col6) #Added by me

    #examine all the VMS in vCenter, if the snapshot has been found - adding to the table

    ForEach ($vm in (Get - VM |)) Sort - Object - property name))

    {

    ForEach ($snapshot in (Get-Snapshot - VM $vm. Name | Sort - Object - property name))

    {

    #$snapevent is how we get the event so that we can see wink creator.  Other variables can be used here.  Notes at the end of

    $snapevent is get-VIEvent-entity $snap. VM-Types of information-finishing $snap. Created MaxSamples - 1 | Where-Object {$_.} FullFormattedMessage - imatch ' task: create instant virtual computer "}"

    $created = - $snapshot split. Created

    $row = $vmtable. NewRow()

    $row. VM = $vm. Name

    $row. Snapshot = $snapshot. Name

    $row. SizeMB = "{0:N0}" f $snapshot. SizeMb

    $row. Created = $created [0]

    $row. Description = $snapshot.description #Added by me

    $row. CreatedBy = $snapevent. Username #Added by me

    $vmtable. Rows.Add ($row)

    }

    }

    #SnapEvents notes:

    #foreach ($snap in Get - VM |) Get - Snapshot)

    #{$snapevent = get-VIEvent-entity $snap. VM-Types of information-finishing $snap. Created MaxSamples - 1 | Where-Object {$_.} FullFormattedMessage - imatch ' task: create instant virtual computer "}"

    #if ($snapevent - not $null) {Write-Host ("VM:"+ $snap. ")} VM + ".." «Snapshot ' "+ $snap +" "created the"+ $snap. "» Created.DateTime + 'by' + $snapevent. (Nom d'utilisateur + ".")}

    #else {write-Host ("VM:"+ $snap. ")} VM + ".." «Snapshot ' "+ $snap +" "created the"+ $snap. "» Created.DateTime + ".." This event is not in vCenter events database")}}

    #

    #Output example output:

    #VM: DC2DC001. Snapshot ' pre - 5.1.2upgrade' created July 28, 2013 07:10:26 by vStrong.info\win8user.

    #VM: DC1DC001. "Pre 5.1.2a upgrade" snapshot created July 28, 2013 07:51:24 by vStrong.info\win7user.

    #VM: DC2APP001. Snapshot "to be resolved before" created on 2 August 2012 14:29:19. This event is not in the database of the vCenter events

    One of the reasons why you empty, could be that the timestamp of the event is not 100% identical to the timestamp of the snapshot.

    Alan SnapReminder , we add a short interval before and after snapshot creation time.

  • Report snapshot. ssmail.txt output

    Hey everyone, trying to make a report snapshot and some return values in a .txt document so I can send by e-mail. I would like to return the virtual machine creation date and the creator's username.

    Everything works fine, except my ssmail.txt output. He wants only to return the user name of the last person who created a snapshot, even if its on a different virtual computer.

    $myVMs = get - VM

    $VMsWithSnaps = @)

    {foreach ($vm to $myVMs)

    $vmView = $vm | Get-View

    If ($vmView.snapshot - not $null) {}

    Write-Host "VM $vm has a snapshot.

    $SnapshotEvents = get-VIEvent-body $vm - type info - MaxSamples 1000 | Where {}

    $_. FullFormattedMessage.contains ("Create virtual machine snapshot")}

    try {}

    $user = $SnapshotEvents [0]. Username

    $time = $SnapshotEvents [0]. Createduserid

    } catch {} [System.Exception]

    $user = $SnapshotEvents.UserName

    $time = $SnapshotEvents.CreatedTime

    }

    $VMInfo = "" | Select 'VM', 'CreationDate', 'user '.

    $VMInfo. "" VM "= $vm. Name

    $VMInfo. "' CreationDate ' = $time

    $VMInfo. "" User "= $user

    $VMsWithSnaps += $VMInfo

    Get - VM | Select-Object - ExpandProperty name | Out-file "C:\scripts\VMList.txt."

    Get-Snapshot - VM (Get-Content C:\scripts\VMList.txt). Select-Object VM, name, creation, $user | Format-List | Out-file C:\scripts\ssmail.txt

    }

    }

    $VMsWithSnaps | CreationDate sorting

    *****************************************************

    It's out of ssmail.txt:

    VM: Lab - vCO VM

    Name: test

    Created on: 07/08/2014-14:01:38

    Adam:

    VM: Lab - vCO VM

    Name: test1

    Created on: 11/08/2014-13:18:39

    Adam:

    VM: Lab - vCO VM

    Name: test2

    Created on: 12/08/2014-09:38:36

    Adam:

    VM: Test VM

    Name: test

    Created: 13/08/2014-09:49:42

    Adam:

    ********************************************************

    It seems that the last person to create a snapshot will have their user name filled with each snapshot release. For example: he says 'Adam' created all snapshots, but "John" had created the first 3 and 'Adam' the last of them.

    Thank you.

    I don't understand why you have the Get - VM and Get-snapshot at the end of the script.

    Try like this (I've simplified a little other things as well)

    $myVMs = get - VM

    {foreach ($vm to $myVMs)

    Get-Snapshot - $vm VM | Tri-objet-property CreationDate-descending | Select - 1 first | %{

    Write-Host "VM $vm has a snapshot.

    $SnapshotEvents = @(get-VIEvent-entité $vm-tapez info-MaxSamples ([int]:: MaxValue) |)

    Where {$_.} FullFormattedMessage.contains ("Create virtual machine snapshot")})

    $_ | Select-Object VM,Name,@{N="Created; E = {$SnapshotEvents [0].} CreatedTime}},@{N="User '; E = {$SnapshotEvents [0].} User name}} |

    Format-List | Out-file C:\ssmail.txt-ajouter

    }

    }

  • Determine which created a snapshot

    This report could be amended to take the person who created a given snapshot:

    Get - vm | Get-snapshot

    Thank you!

    In the script of SnapReminder of Alan, there is a function of my friends that retrieves the creator of a snapshot of events.

  • new time machine snapshots copied to the old directory of the machine not recognized

    I had a time Capsule 2 TB which showered, and I started a new backup (a USB key) by mode Apple drive. It took me a while to return to deal with the old clichés left on my Time Capsule. I found nothing specific online to tell me how to deal with this, so I made a few decisions naïve. I've disabled the Time Machine, renamed my new store backup and copied over the old store backup on the new backup drive time Capsule. Then in a Terminal on the command line, I mvhad snapshot directories in the newly copied backup of the old backup store store renamed folder. NOTE: On this site, I learned about a Time Machine of assistance called bypasscommand, and I needed to use it to move the Flash files in the command line:

    $ sudo mv 2016-09-17-211302 /System/Library/Extensions/TMSafetyNet.kext/Contents/Helpers/bypass.

    .. /.. /Backups.BackupDB/MyMachine /

    At this point, I thought: well, now, I have all my old and new pictures in the active backup store on the local USB drive. Then I turned on the Time Machine, and the first backup failed:

    "An error occurred during the file copying. The problem may be temporary. If the problem persists, use disk utility to repair your backup disk. »

    Then I noticed that Finder shows only most original snapshots while in the Terminal, I see all snapshots using the ls command. All snapshots have the same names in fashion and the owner/group permissions. So, why don't Finder shows all snapshots and why is Time Machine unhappy?

    Given that I can't modify my own * post, here are the corrections and updates of the original:

    I had a time Capsule 2 TB which showered, and I started a new backup (a USB key) by mode Apple drive. It took me a while to return to deal with the old clichés left on my Time Capsule. I found nothing specific online to tell me how to deal with this, so I made a few decisions naïve. I've disabled the Time Machine, renamed my new store backup and copied over the old store backup on the new backup drive time Capsule. Then in a Terminal on the command line, I mvhad snapshot directories in the newly copied backup of the old backup store store renamed folder. NOTE: On this site, I learned about a Time Machine called command help work around, and I needed to use it to move the Flash files in the command line:

    $ sudo mv 2016-09-17-211302 /System/Library/Extensions/TMSafetyNet.kext/Contents/Helpers/bypass.

    .. /.. /Backups.BackupDB/MyMachine/

    At this point, I thought: well, now, I have all my old and new pictures in the active backup store on the local USB drive. Then I turned on the Time Machine, and the first backup failed:

    "An error occurred during the file copying. The problem may be temporary. If the problem persists, use disk utility to repair your backup disk. »

    Then I noticed that Finder shows only most original snapshots while in the Terminal, I see all snapshots using the ls command. All snapshots have the same names in fashion and the owner/group permissions.

    Then, I thought that the Finder was confused somehow. I turned off Time machine and ejected from the USB drive. When I plugged back it it, of course now Finder shows all snapshots. The tmutil listbackups command confirms also all snapshots. I started a new backup, but it has not yet.

  • using Book Creator on iPad

    I use Book Creator on iPad to make small audio files containing books, text, photos, videos for my grandchildren live on the other side of the world. What is the best way to share these 'books' with them, please?

    e mailer or put them on a sharing as dropbox service

  • How to take a snapshot of my screen of firefox

    I want to take a snapshot of my mobile firefox

    Hi Roshan,

    Depending on your Firefox OS device, you can take a screenshot with one of the following key combinations:

    • Power + Home button
    • Power + Volume down

    You can also see the help article for more details: https://support.mozilla.org/en-US/kb/how-to-take-screenshots-firefox-os

    I hope you find this information useful. Please let us know if you have other questions about your Firefox OS device.

    Thank you

    -Ralph

  • Snapshot, Naming Convention

    Is it possible to change the snapshots naming convention?

    Work on a shared storage system uses NTFS on the back end so "/" is a character not consistent therefore generate snapshots fail.

    Not as far as I know. You should certainly file a feature request for this because by default immediately uses the date/time stamp, which really should not use the /.

  • HP Photo Creations: The Photo Creator image file Conversion

    Trying to help a friend. She has an HP printer and used HP Photo Creator.

    However, the program (with his help) has managed to convert all files on several DVD into JPG files that cannot be opened by using the Photo Creator software. Other programs refuse to open the files, saying they are invalid or damaged. Yet HP Photo Creator opens fine.

    She requested that its JPGs to be accessible using any image look a program (this seems reasonable).

    Is it possible to convert these files into a format that can be used by any photo/picture read/write software please?

    Thanks in advance.
    T.

    10 Windows user | not much computer, but I'll give it a go. using South African internet (it is not the fastest). decent, friendly people.

    Hi MIghtyBeagel,

    I suggest call and assistance remotely.

    Here is the link to contact HP: phone help worldwide.

    Thank you!

  • Satellite P205-S6287 - webcam only takes snapshots using Win 7

    Hello.

    I recently updated my laptop from Windows Vista to Windows 7 Ultimate (32 bit).
    When I did, I went through the typical rigmarole of updating my drivers and reinstall some programs or games lost. What I wasn't expecting, it was for my camera to completely stop working.

    I reinstalled the software of the camera, and it seemed to work until I tried to take a snapshot with the software after that. Now, the camera records video and audio recording, but it will not instant (I mainly use for).

    If I click on the Snapshot button, she acts like I clicked it, but no preview image and no new photos are saved in the folder my pictures.

    Any ideas? Or advice? Or help? Thank you!

    Hello

    Perhaps you should again check the path to the photo folder?
    Maybe the webcam records the images to another location on the HARD drive

  • Impossible to uninstall Toshiba Recovery Media Creator

    Hello

    I can't seem to uninstall Recovery Media Creator every time I try to uninstall I seem to get a red x error message with the error code (-5005: 0 x 80070002),.

    I think that this has been caused by the system restore, it can removed a file in the folder of the Trusted Installer, I tried literally everything I know but can't seem to remove it.

    I got my recovery so I tried to remove it because of that and bothers me like when I can't remove a program, I have no idea how to manually remove programs but I have a little knowledge with systems operating so if theres any advice on that would be great.

    Kind regards
    Kaya90

    Visit the Toshiba download page, download and reinstall Toshiba Recovery Media Creator. I hope this will solve your problem and then do what you will be able to remove it.

  • Where can I find to download Toshiba disc creator?

    Hello

    I can't download Toshiba disc creator software in the Toshiba driver download pages.
    Where can I download it?

    Thanks for this info

  • No recovery Partition - question Recovery Media Creator

    Somehow, I don't have a recovery partition on my hard drive but have Toshiba Media creator on my desk?

    Images below:

    No recovery Partition? :

    + The message was edited: no labour relations have been removed.

    Hello

    It seems that the recovery media creator software is always installed, but the HARD drive recovery partition has been deleted from the HARD drive.

    This is why the recovery media creator can't access the HARD drive recovery partition.

    What to say. In this case, you will not be able to create the recovery media :(

    But you can order this disc from here:
    http://backupmedia.Toshiba.EU/landing.aspx

  • I need to install TOSHIBA Recovery Disc Creator on Qosmio F60 - 11F

    Hello.

    I have a Qosmio F60 - 11F and I install windows 7 ultimate 64-bit, I have installed all the drivers from the Toshiba site.
    I need to install the TOSHIBA Recovery Disc Creator & TOSHIBA Recovery Media Creator utilities; I search in the Toshiba site, but nothing is there.
    Can someone help me to download these utilities?

    Why do you need these tools?
    If you have installed your own version of the OS, these tools are useless, and for this reason, they are not available for download and installation.
    These tools, you can have if you install Toshiba recovery image only.

Maybe you are looking for