{"id":176,"date":"2014-12-23T00:23:15","date_gmt":"2014-12-23T00:23:15","guid":{"rendered":"http:\/\/vdssystems.wordpress.com\/?p=176"},"modified":"2016-10-26T12:43:04","modified_gmt":"2016-10-26T12:43:04","slug":"how-to-get-vm-creation-date-powercli-script","status":"publish","type":"post","link":"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/","title":{"rendered":"How to get VM creation date PowerCLI script"},"content":{"rendered":"<p>I had a customer who wanted to know who created the vm and when<\/p>\n<p>so i started to look on the internet to see if anyone wrote a script already<\/p>\n<p>and some one did. so thank you <a href=\"http:\/\/www.vmspot.com\/?p=241\">Matt Bradford<\/a><\/p>\n<p>here is his script and i tested on my vmware vsphere 5.5 U1 home lab and worked without erros<\/p>\n<p>#Enter your vCenter Host below<\/p>\n<div class=\"line number2 index1 alt1\"><code class=\"powershell value\">$vcenter<\/code> <code class=\"powershell plain\">= <\/code><code class=\"powershell string\">\"your_vcenter_server\"<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"powershell comments\">#Enter the CSV file to be created<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"powershell value\">$csvfile<\/code> <code class=\"powershell plain\">= <\/code><code class=\"powershell string\">\"VM_Birthdays.CSV\"<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"powershell comments\">################################<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"powershell comments\">#Load the VMware Powershell snapin if the script is being executed in PowerShell<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"powershell keyword\">Add-PSSnapin<\/code> <code class=\"powershell plain\">VMware.VimAutomation.Core <\/code><code class=\"powershell keyword\">-ErrorAction<\/code> <code class=\"powershell string\">'SilentlyContinue'<\/code><\/div>\n<div class=\"line number9 index8 alt2\"><\/div>\n<div class=\"line number10 index9 alt1\"><code class=\"powershell comments\">#Connect to the vCenter server defined above. Ignore certificate errors<\/code><\/div>\n<div class=\"line number11 index10 alt2\"><code class=\"powershell keyword\">Write-Host<\/code> <code class=\"powershell string\">\"Connecting to vCenter\"<\/code><\/div>\n<div class=\"line number12 index11 alt1\"><code class=\"powershell plain\">Connect<\/code><code class=\"powershell keyword\">-VIServer<\/code> <code class=\"powershell value\">$vcenter<\/code> <code class=\"powershell keyword\">-wa<\/code> <code class=\"powershell plain\">0<\/code><\/div>\n<div class=\"line number13 index12 alt2\"><code class=\"powershell keyword\">Write-Host<\/code> <code class=\"powershell string\">\"Connected\"<\/code><\/div>\n<div class=\"line number14 index13 alt1\"><code class=\"powershell keyword\">Write-Host<\/code> <code class=\"powershell string\">\"\"<\/code><\/div>\n<div class=\"line number15 index14 alt2\"><\/div>\n<div class=\"line number16 index15 alt1\"><code class=\"powershell comments\">#Check to see if the file exists, if it does then overwrite it.<\/code><\/div>\n<div class=\"line number17 index16 alt2\"><code class=\"powershell plain\">if (<\/code><code class=\"powershell keyword\">Test-Path<\/code> <code class=\"powershell value\">$csvfile<\/code><code class=\"powershell plain\">) {<\/code><\/div>\n<div class=\"line number18 index17 alt1\"><code class=\"powershell keyword\">Write-Host<\/code> <code class=\"powershell string\">\"Overwriting $csvfile\"<\/code><\/div>\n<div class=\"line number19 index18 alt2\"><code class=\"powershell keyword\">del<\/code> <code class=\"powershell value\">$csvfile<\/code><\/div>\n<div class=\"line number20 index19 alt1\"><code class=\"powershell plain\">}<\/code><\/div>\n<div class=\"line number21 index20 alt2\"><\/div>\n<div class=\"line number22 index21 alt1\"><code class=\"powershell comments\">#Create the CSV title header<\/code><\/div>\n<div class=\"line number23 index22 alt2\"><code class=\"powershell keyword\">Add-Content<\/code> <code class=\"powershell value\">$csvfile<\/code> <code class=\"powershell string\">\"VM,Born on,Creator,Creation Type,Event Message\"<\/code><\/div>\n<div class=\"line number24 index23 alt1\"><\/div>\n<div class=\"line number25 index24 alt2\"><code class=\"powershell comments\">#Gather all VM's from vCenter<\/code><\/div>\n<div class=\"line number26 index25 alt1\"><code class=\"powershell value\">$vms<\/code> <code class=\"powershell plain\">= Get<\/code><code class=\"powershell keyword\">-VM<\/code> <code class=\"powershell plain\">| <\/code><code class=\"powershell keyword\">sort<\/code> <code class=\"powershell plain\">Name<\/code><\/div>\n<div class=\"line number27 index26 alt2\"><\/div>\n<div class=\"line number28 index27 alt1\"><code class=\"powershell keyword\">foreach<\/code> <code class=\"powershell plain\">(<\/code><code class=\"powershell value\">$VM<\/code> <code class=\"powershell plain\">in <\/code><code class=\"powershell value\">$vms<\/code><code class=\"powershell plain\">) {<\/code><\/div>\n<div class=\"line number29 index28 alt2\"><code class=\"powershell keyword\">Write-Host<\/code> <code class=\"powershell string\">\"Gathering info for $VM\"<\/code><\/div>\n<div class=\"line number30 index29 alt1\"><\/div>\n<div class=\"line number31 index30 alt2\"><code class=\"powershell comments\">#Search for events where the VM was deployed from a template<\/code><\/div>\n<div class=\"line number32 index31 alt1\"><code class=\"powershell value\">$vmevents<\/code> <code class=\"powershell plain\">= Get<\/code><code class=\"powershell keyword\">-VIEvent<\/code> <code class=\"powershell value\">$VM<\/code> <code class=\"powershell keyword\">-MaxSamples<\/code><code class=\"powershell plain\">(<div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 hundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-overflow:visible;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last fusion-column-no-min-height\" style=\"--awb-bg-size:cover;--awb-margin-bottom:0px;\"><div class=\"fusion-column-wrapper fusion-flex-column-wrapper-legacy\">[int]::MaxValue) | <\/code><code class=\"powershell keyword\">Where-Object<\/code> <code class=\"powershell plain\">{$_.FullFormattedMessage <\/code><code class=\"powershell keyword\">-like<\/code> <code class=\"powershell string\">\"Deploying*\"<\/code><code class=\"powershell plain\">} |<\/code><code class=\"powershell keyword\">Select<\/code> <code class=\"powershell plain\">CreatedTime, UserName, FullFormattedMessage<\/code><\/div>\n<div class=\"line number33 index32 alt2\"><code class=\"powershell plain\">if (<\/code><code class=\"powershell value\">$vmevents<\/code><code class=\"powershell plain\">)<\/code><\/div>\n<div class=\"line number34 index33 alt1\"><code class=\"powershell plain\">{<\/code><\/div>\n<div class=\"line number35 index34 alt2\"><code class=\"powershell value\">$type<\/code> <code class=\"powershell plain\">= <\/code><code class=\"powershell string\">\"From Template\"<\/code><\/div>\n<div class=\"line number36 index35 alt1\"><code class=\"powershell plain\">}<\/code><\/div>\n<div class=\"line number37 index36 alt2\"><\/div>\n<div class=\"line number38 index37 alt1\"><code class=\"powershell comments\">#If no events were found, search for events where the VM was created from scratch<\/code><\/div>\n<div class=\"line number39 index38 alt2\"><code class=\"powershell plain\">if (!<\/code><code class=\"powershell value\">$vmevents<\/code><code class=\"powershell plain\">) {<\/code><\/div>\n<div class=\"line number40 index39 alt1\"><code class=\"powershell value\">$vmevents<\/code> <code class=\"powershell plain\">= Get<\/code><code class=\"powershell keyword\">-VIEvent<\/code> <code class=\"powershell value\">$VM<\/code> <code class=\"powershell keyword\">-MaxSamples<\/code><code class=\"powershell plain\">([int]::MaxValue) | <\/code><code class=\"powershell keyword\">Where-Object<\/code> <code class=\"powershell plain\">{$_.FullFormattedMessage <\/code><code class=\"powershell keyword\">-like<\/code> <code class=\"powershell string\">\"Created*\"<\/code><code class=\"powershell plain\">} |<\/code><code class=\"powershell keyword\">Select<\/code> <code class=\"powershell plain\">CreatedTime, UserName, FullFormattedMessage<\/code><\/div>\n<div class=\"line number41 index40 alt2\"><code class=\"powershell keyword\">Write-Host<\/code> <code class=\"powershell string\">\"Searching by Created\"<\/code><\/div>\n<div class=\"line number42 index41 alt1\"><code class=\"powershell value\">$type<\/code> <code class=\"powershell plain\">= <\/code><code class=\"powershell string\">\"From Scratch\"<\/code><\/div>\n<div class=\"line number43 index42 alt2\"><code class=\"powershell plain\">}<\/code><\/div>\n<div class=\"line number44 index43 alt1\"><\/div>\n<div class=\"line number45 index44 alt2\"><code class=\"powershell comments\">#If no events were found, search for events where the VM was cloned<\/code><\/div>\n<div class=\"line number46 index45 alt1\"><code class=\"powershell plain\">if (!<\/code><code class=\"powershell value\">$vmevents<\/code><code class=\"powershell plain\">) {<\/code><\/div>\n<div class=\"line number47 index46 alt2\"><code class=\"powershell value\">$vmevents<\/code> <code class=\"powershell plain\">= Get<\/code><code class=\"powershell keyword\">-VIEvent<\/code> <code class=\"powershell value\">$VM<\/code> <code class=\"powershell keyword\">-MaxSamples<\/code><code class=\"powershell plain\">([int]::MaxValue) | <\/code><code class=\"powershell keyword\">Where-Object<\/code> <code class=\"powershell plain\">{$_.FullFormattedMessage <\/code><code class=\"powershell keyword\">-like<\/code> <code class=\"powershell string\">\"Clone*\"<\/code><code class=\"powershell plain\">} |<\/code><code class=\"powershell keyword\">Select<\/code> <code class=\"powershell plain\">CreatedTime, UserName, FullFormattedMessage<\/code><\/div>\n<div class=\"line number48 index47 alt1\"><code class=\"powershell keyword\">Write-Host<\/code> <code class=\"powershell string\">\"Searching by Cloned\"<\/code><\/div>\n<div class=\"line number49 index48 alt2\"><code class=\"powershell value\">$type<\/code> <code class=\"powershell plain\">= <\/code><code class=\"powershell string\">\"Cloned\"<\/code><\/div>\n<div class=\"line number50 index49 alt1\"><code class=\"powershell plain\">}<\/code><\/div>\n<div class=\"line number51 index50 alt2\"><\/div>\n<div class=\"line number52 index51 alt1\"><code class=\"powershell comments\">#If no events were found, search for events where the VM was discovered<\/code><\/div>\n<div class=\"line number53 index52 alt2\"><code class=\"powershell plain\">if (!<\/code><code class=\"powershell value\">$vmevents<\/code><code class=\"powershell plain\">) {<\/code><\/div>\n<div class=\"line number54 index53 alt1\"><code class=\"powershell value\">$vmevents<\/code> <code class=\"powershell plain\">= Get<\/code><code class=\"powershell keyword\">-VIEvent<\/code> <code class=\"powershell value\">$VM<\/code> <code class=\"powershell keyword\">-MaxSamples<\/code><code class=\"powershell plain\">([int]::MaxValue) | <\/code><code class=\"powershell keyword\">Where-Object<\/code> <code class=\"powershell plain\">{$_.FullFormattedMessage <\/code><code class=\"powershell keyword\">-like<\/code> <code class=\"powershell string\">\"Discovered*\"<\/code><code class=\"powershell plain\">} |<\/code><code class=\"powershell keyword\">Select<\/code> <code class=\"powershell plain\">CreatedTime, UserName, FullFormattedMessage<\/code><\/div>\n<div class=\"line number55 index54 alt2\"><code class=\"powershell keyword\">Write-Host<\/code> <code class=\"powershell string\">\"Searching by Discovered\"<\/code><\/div>\n<div class=\"line number56 index55 alt1\"><code class=\"powershell value\">$type<\/code> <code class=\"powershell plain\">= <\/code><code class=\"powershell string\">\"Discovered\"<\/code><\/div>\n<div class=\"line number57 index56 alt2\"><code class=\"powershell plain\">}<\/code><\/div>\n<div class=\"line number58 index57 alt1\"><\/div>\n<div class=\"line number59 index58 alt2\"><code class=\"powershell comments\">#If no events were found, search for events where the VM was connected (typically from Backup Restores)<\/code><\/div>\n<div class=\"line number60 index59 alt1\"><code class=\"powershell plain\">if (!<\/code><code class=\"powershell value\">$vmevents<\/code><code class=\"powershell plain\">) {<\/code><\/div>\n<div class=\"line number61 index60 alt2\"><code class=\"powershell value\">$vmevents<\/code> <code class=\"powershell plain\">= Get<\/code><code class=\"powershell keyword\">-VIEvent<\/code> <code class=\"powershell value\">$VM<\/code> <code class=\"powershell keyword\">-MaxSamples<\/code><code class=\"powershell plain\">([int]::MaxValue) | <\/code><code class=\"powershell keyword\">Where-Object<\/code> <code class=\"powershell plain\">{$_.FullFormattedMessage <\/code><code class=\"powershell keyword\">-like<\/code> <code class=\"powershell string\">\"* connected\"<\/code><code class=\"powershell plain\">} |<\/code><code class=\"powershell keyword\">Select<\/code> <code class=\"powershell plain\">CreatedTime, UserName, FullFormattedMessage<\/code><\/div>\n<div class=\"line number62 index61 alt1\"><code class=\"powershell keyword\">Write-Host<\/code> <code class=\"powershell string\">\"Searching by Connected\"<\/code><\/div>\n<div class=\"line number63 index62 alt2\"><code class=\"powershell value\">$type<\/code> <code class=\"powershell plain\">= <\/code><code class=\"powershell string\">\"Connected\"<\/code><\/div>\n<div class=\"line number64 index63 alt1\"><code class=\"powershell plain\">}<\/code><\/div>\n<div class=\"line number65 index64 alt2\"><\/div>\n<div class=\"line number66 index65 alt1\"><code class=\"powershell comments\">#I have no idea how this VM came to be.<\/code><\/div>\n<div class=\"line number67 index66 alt2\"><code class=\"powershell plain\">if (!<\/code><code class=\"powershell value\">$vmevents<\/code><code class=\"powershell plain\">) {<\/code><\/div>\n<div class=\"line number68 index67 alt1\"><code class=\"powershell keyword\">Write-Host<\/code> <code class=\"powershell string\">\"No clue how this VM got here!\"<\/code><\/div>\n<div class=\"line number69 index68 alt2\"><code class=\"powershell value\">$type<\/code> <code class=\"powershell plain\">= <\/code><code class=\"powershell string\">\"Immaculate Conception\"<\/code><\/div>\n<div class=\"line number70 index69 alt1\"><code class=\"powershell plain\">}<\/code><\/div>\n<div class=\"line number71 index70 alt2\"><\/div>\n<div class=\"line number72 index71 alt1\"><code class=\"powershell comments\">#In some cases there may be more than one event found (typically from VM restores). This will include each event in the CSV for the user to interpret.<\/code><\/div>\n<div class=\"line number73 index72 alt2\"><code class=\"powershell keyword\">foreach<\/code> <code class=\"powershell plain\">(<\/code><code class=\"powershell value\">$event<\/code> <code class=\"powershell plain\">in <\/code><code class=\"powershell value\">$vmevents<\/code><code class=\"powershell plain\">) {<\/code><\/div>\n<div class=\"line number74 index73 alt1\"><\/div>\n<div class=\"line number75 index74 alt2\"><code class=\"powershell comments\">#Prepare the entries<\/code><\/div>\n<div class=\"line number76 index75 alt1\"><code class=\"powershell value\">$birthday<\/code> <code class=\"powershell plain\">= <\/code><code class=\"powershell value\">$event<\/code><code class=\"powershell plain\">.CreatedTime.ToString(<\/code><code class=\"powershell string\">\"MM\/dd\/yy\"<\/code><code class=\"powershell plain\">)<\/code><\/div>\n<div class=\"line number77 index76 alt2\"><code class=\"powershell value\">$parent<\/code> <code class=\"powershell plain\">= <\/code><code class=\"powershell value\">$event<\/code><code class=\"powershell plain\">.Username<\/code><\/div>\n<div class=\"line number78 index77 alt1\"><code class=\"powershell value\">$message<\/code> <code class=\"powershell plain\">= <\/code><code class=\"powershell value\">$event<\/code><code class=\"powershell plain\">.FullFormattedMessage<\/code><\/div>\n<div class=\"line number79 index78 alt2\"><\/div>\n<div class=\"line number80 index79 alt1\"><code class=\"powershell comments\">#Add the entries to the CSV<\/code><\/div>\n<div class=\"line number81 index80 alt2\"><code class=\"powershell value\">$write<\/code> <code class=\"powershell plain\">= <\/code><code class=\"powershell string\">\"$VM, $birthday, $parent, $type, $message\"<\/code><\/div>\n<div class=\"line number82 index81 alt1\"><code class=\"powershell keyword\">Add-Content<\/code> <code class=\"powershell value\">$csvfile<\/code> <code class=\"powershell value\">$write<\/code><\/div>\n<div class=\"line number83 index82 alt2\"><code class=\"powershell plain\">}<\/code><\/div>\n<div class=\"line number84 index83 alt1\"><code class=\"powershell plain\">}<\/code><\/div>\n<div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had a customer who wanted to know who created the vm and when so i started to look on the internet to see if anyone wrote a script already and some one did. so thank you Matt Bradford here is his script and i tested on my vmware vsphere 5.5 U1 home lab and worked without erros #Enter your vCenter Host below $vcenter = &#8220;your_vcenter_server&#8221; #Enter the CSV file to be created $csvfile = &#8220;VM_Birthdays.CSV&#8221; ################################ #Load the VMware Powershell snapin if the script is being executed in PowerShell Add-PSSnapin VMware.VimAutomation.Core -ErrorAction &#8216;SilentlyContinue&#8217; #Connect to the vCenter server defined [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[11],"tags":[58,86],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.10 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to get VM creation date PowerCLI script - Vds Systems<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to get VM creation date PowerCLI script - Vds Systems\" \/>\n<meta property=\"og:description\" content=\"I had a customer who wanted to know who created the vm and when so i started to look on the internet to see if anyone wrote a script already and some one did. so thank you Matt Bradford here is his script and i tested on my vmware vsphere 5.5 U1 home lab and worked without erros #Enter your vCenter Host below $vcenter = &quot;your_vcenter_server&quot; #Enter the CSV file to be created $csvfile = &quot;VM_Birthdays.CSV&quot; ################################ #Load the VMware Powershell snapin if the script is being executed in PowerShell Add-PSSnapin VMware.VimAutomation.Core -ErrorAction &#039;SilentlyContinue&#039; #Connect to the vCenter server defined [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/\" \/>\n<meta property=\"og:site_name\" content=\"Vds Systems\" \/>\n<meta property=\"article:published_time\" content=\"2014-12-23T00:23:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-10-26T12:43:04+00:00\" \/>\n<meta name=\"author\" content=\"vervoortjurgen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vervoortjurgen\" \/>\n<meta name=\"twitter:site\" content=\"@vervoortjurgen\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"vervoortjurgen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/\"},\"author\":{\"name\":\"vervoortjurgen\",\"@id\":\"https:\/\/www.vdssystems.be\/#\/schema\/person\/b5b5d8b618d18707214c3e029fa9383d\"},\"headline\":\"How to get VM creation date PowerCLI script\",\"datePublished\":\"2014-12-23T00:23:15+00:00\",\"dateModified\":\"2016-10-26T12:43:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/\"},\"wordCount\":79,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/www.vdssystems.be\/#organization\"},\"keywords\":[\"powercli\",\"vmware\"],\"articleSection\":[\"Vmware\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/\",\"url\":\"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/\",\"name\":\"How to get VM creation date PowerCLI script - Vds Systems\",\"isPartOf\":{\"@id\":\"https:\/\/www.vdssystems.be\/#website\"},\"datePublished\":\"2014-12-23T00:23:15+00:00\",\"dateModified\":\"2016-10-26T12:43:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vdssystems.be\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to get VM creation date PowerCLI script\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vdssystems.be\/#website\",\"url\":\"https:\/\/www.vdssystems.be\/\",\"name\":\"Vds Systems\",\"description\":\"IT services, Cloud services, Consulting, IT administration\",\"publisher\":{\"@id\":\"https:\/\/www.vdssystems.be\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vdssystems.be\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vdssystems.be\/#organization\",\"name\":\"VDS Systems\",\"url\":\"https:\/\/www.vdssystems.be\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vdssystems.be\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/www.vdssystems.be\/wp-content\/uploads\/2015\/12\/VDS_small.png\",\"contentUrl\":\"http:\/\/www.vdssystems.be\/wp-content\/uploads\/2015\/12\/VDS_small.png\",\"width\":180,\"height\":120,\"caption\":\"VDS Systems\"},\"image\":{\"@id\":\"https:\/\/www.vdssystems.be\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/vds-systems\",\"https:\/\/www.youtube.com\/channel\/UCaYZXRM9FrWROJEBXFj25zQ\",\"https:\/\/twitter.com\/vervoortjurgen\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.vdssystems.be\/#\/schema\/person\/b5b5d8b618d18707214c3e029fa9383d\",\"name\":\"vervoortjurgen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vdssystems.be\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b53b7f9d6596a0083a5866c89c364349?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b53b7f9d6596a0083a5866c89c364349?s=96&d=mm&r=g\",\"caption\":\"vervoortjurgen\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to get VM creation date PowerCLI script - Vds Systems","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/","og_locale":"en_US","og_type":"article","og_title":"How to get VM creation date PowerCLI script - Vds Systems","og_description":"I had a customer who wanted to know who created the vm and when so i started to look on the internet to see if anyone wrote a script already and some one did. so thank you Matt Bradford here is his script and i tested on my vmware vsphere 5.5 U1 home lab and worked without erros #Enter your vCenter Host below $vcenter = \"your_vcenter_server\" #Enter the CSV file to be created $csvfile = \"VM_Birthdays.CSV\" ################################ #Load the VMware Powershell snapin if the script is being executed in PowerShell Add-PSSnapin VMware.VimAutomation.Core -ErrorAction 'SilentlyContinue' #Connect to the vCenter server defined [&hellip;]","og_url":"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/","og_site_name":"Vds Systems","article_published_time":"2014-12-23T00:23:15+00:00","article_modified_time":"2016-10-26T12:43:04+00:00","author":"vervoortjurgen","twitter_card":"summary_large_image","twitter_creator":"@vervoortjurgen","twitter_site":"@vervoortjurgen","twitter_misc":{"Written by":"vervoortjurgen","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/#article","isPartOf":{"@id":"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/"},"author":{"name":"vervoortjurgen","@id":"https:\/\/www.vdssystems.be\/#\/schema\/person\/b5b5d8b618d18707214c3e029fa9383d"},"headline":"How to get VM creation date PowerCLI script","datePublished":"2014-12-23T00:23:15+00:00","dateModified":"2016-10-26T12:43:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/"},"wordCount":79,"commentCount":2,"publisher":{"@id":"https:\/\/www.vdssystems.be\/#organization"},"keywords":["powercli","vmware"],"articleSection":["Vmware"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/","url":"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/","name":"How to get VM creation date PowerCLI script - Vds Systems","isPartOf":{"@id":"https:\/\/www.vdssystems.be\/#website"},"datePublished":"2014-12-23T00:23:15+00:00","dateModified":"2016-10-26T12:43:04+00:00","breadcrumb":{"@id":"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vdssystems.be\/en\/2014\/12\/how-to-get-vm-creation-date-powercli-script\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vdssystems.be\/en\/"},{"@type":"ListItem","position":2,"name":"How to get VM creation date PowerCLI script"}]},{"@type":"WebSite","@id":"https:\/\/www.vdssystems.be\/#website","url":"https:\/\/www.vdssystems.be\/","name":"Vds Systems","description":"IT services, Cloud services, Consulting, IT administration","publisher":{"@id":"https:\/\/www.vdssystems.be\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vdssystems.be\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vdssystems.be\/#organization","name":"VDS Systems","url":"https:\/\/www.vdssystems.be\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vdssystems.be\/#\/schema\/logo\/image\/","url":"http:\/\/www.vdssystems.be\/wp-content\/uploads\/2015\/12\/VDS_small.png","contentUrl":"http:\/\/www.vdssystems.be\/wp-content\/uploads\/2015\/12\/VDS_small.png","width":180,"height":120,"caption":"VDS Systems"},"image":{"@id":"https:\/\/www.vdssystems.be\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/company\/vds-systems","https:\/\/www.youtube.com\/channel\/UCaYZXRM9FrWROJEBXFj25zQ","https:\/\/twitter.com\/vervoortjurgen"]},{"@type":"Person","@id":"https:\/\/www.vdssystems.be\/#\/schema\/person\/b5b5d8b618d18707214c3e029fa9383d","name":"vervoortjurgen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vdssystems.be\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b53b7f9d6596a0083a5866c89c364349?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b53b7f9d6596a0083a5866c89c364349?s=96&d=mm&r=g","caption":"vervoortjurgen"}}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.vdssystems.be\/en\/wp-json\/wp\/v2\/posts\/176\/"}],"collection":[{"href":"https:\/\/www.vdssystems.be\/en\/wp-json\/wp\/v2\/posts\/"}],"about":[{"href":"https:\/\/www.vdssystems.be\/en\/wp-json\/wp\/v2\/types\/post\/"}],"author":[{"embeddable":true,"href":"https:\/\/www.vdssystems.be\/en\/wp-json\/wp\/v2\/users\/2\/"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vdssystems.be\/en\/wp-json\/wp\/v2\/comments\/?post=176"}],"version-history":[{"count":1,"href":"https:\/\/www.vdssystems.be\/en\/wp-json\/wp\/v2\/posts\/176\/revisions\/"}],"predecessor-version":[{"id":1270,"href":"https:\/\/www.vdssystems.be\/en\/wp-json\/wp\/v2\/posts\/176\/revisions\/1270\/"}],"wp:attachment":[{"href":"https:\/\/www.vdssystems.be\/en\/wp-json\/wp\/v2\/media\/?parent=176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vdssystems.be\/en\/wp-json\/wp\/v2\/categories\/?post=176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vdssystems.be\/en\/wp-json\/wp\/v2\/tags\/?post=176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}