{"id":1970,"date":"2021-02-09T18:55:09","date_gmt":"2021-02-10T00:55:09","guid":{"rendered":"https:\/\/www.ciraltos.com\/?p=1970"},"modified":"2023-03-23T06:43:31","modified_gmt":"2023-03-23T11:43:31","slug":"get-azure-scheduled-events-with-imds","status":"publish","type":"post","link":"http:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/","title":{"rendered":"Get Azure Scheduled Events with IMDS"},"content":{"rendered":"\n<figure class=\"wp-block-image alignleft size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"142\" height=\"181\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2021\/02\/Azure-Log-Analytics.png\" alt=\"\" class=\"wp-image-1971\"\/><\/figure>\n\n\n\n<p>In this video, we go over how to get scheduled events for an Azure virtual machine by querying the Instance Metadata service API endpoint with a PowerShell Scheduled Task.&nbsp; That data is then sent to a Log Analytics Workspace to be queried or alerted on.<\/p>\n\n\n\n<!--more-->\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"ast-oembed-container\" style=\"height: 100%;\"><iframe loading=\"lazy\" title=\"Get Azure Scheduled Events with IMDS\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/KPIjteBIciw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<p>Sample query to get all events:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">IMDSScheduledEvents_CL <br>| sort by DateTime_t desc <\/pre>\n\n\n\n<p> Sample query to get all events that are not blank: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">IMDSScheduledEvents_CL \n| where Events_s != \"[]\"\n| sort by DateTime_t desc <\/pre>\n\n\n\n<h2>Links:<\/h2>\n\n\n\n<p>Udemy course, Zero to Hero with Windows Virtual Desktop<br> <a href=\"https:\/\/www.udemy.com\/course\/zero-to-hero-with-windows-virtual-desktop\/?referralCode=B2FE49E6FCEE7A7EA8D4\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"https:\/\/www.udemy.com\/course\/zero-to-hero-with-windows-virtual-desktop\/ (opens in a new tab)\">https:\/\/www.udemy.com\/course\/zero-to-hero-with-windows-virtual-desktop\/<\/a><\/p>\n\n\n\n<p>Two IP\u2019s you should know:<br><a rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\" href=\"https:\/\/www.ciraltos.com\/two-azure-ip-addresses-you-need-to-know-about\/\" target=\"_blank\">https:\/\/www.ciraltos.com\/two-azure-ip-addresses-you-need-to-know-about\/<\/a><\/p>\n\n\n\n<p>Script on GitHub:<br><a rel=\"noreferrer noopener\" aria-label=\" https:\/\/github.com\/tsrob50\/WVD-Public\/blob\/master\/Get-ScheduledEvents.ps1  (opens in a new tab)\" href=\"https:\/\/github.com\/tsrob50\/WVD-Public\/blob\/master\/Get-ScheduledEvents.ps1\" target=\"_blank\"> https:\/\/github.com\/tsrob50\/WVD-Public\/blob\/master\/Get-ScheduledEvents.ps1 <\/a><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this video, we go over how to get scheduled events for an Azure virtual machine by querying the Instance Metadata service API endpoint with a PowerShell Scheduled Task.&nbsp; That data is then sent to a Log Analytics Workspace to be queried or alerted on.<\/p>\n","protected":false},"author":1,"featured_media":3872,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[2,272,1],"tags":[790,9,939,938,899,495,943,789,202,20,65,942,40,937,940],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Get Azure Scheduled Events with IMDS - ciraltos<\/title>\n<meta name=\"description\" content=\"In this video, we get scheduled events for an Azure virtual machine by querying the Instance Metadata service API endpoint.\" \/>\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.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get Azure Scheduled Events with IMDS - ciraltos\" \/>\n<meta property=\"og:description\" content=\"In this video, we get scheduled events for an Azure virtual machine by querying the Instance Metadata service API endpoint.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/\" \/>\n<meta property=\"og:site_name\" content=\"ciraltos\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-10T00:55:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-23T11:43:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Azure-Log-Analytics.png\" \/>\n\t<meta property=\"og:image:width\" content=\"142\" \/>\n\t<meta property=\"og:image:height\" content=\"181\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Travis Roberts\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ciraltos\" \/>\n<meta name=\"twitter:site\" content=\"@ciraltos\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Travis Roberts\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/\"},\"author\":{\"name\":\"Travis Roberts\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"headline\":\"Get Azure Scheduled Events with IMDS\",\"datePublished\":\"2021-02-10T00:55:09+00:00\",\"dateModified\":\"2023-03-23T11:43:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/\"},\"wordCount\":111,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"keywords\":[\"169.254.169.254\",\"Azure\",\"Azure Free\",\"Azure Instance Metadata Service Instance Metadata Service\",\"azure management\",\"azure training\",\"freeze\",\"IMDS\",\"Log Analytics\",\"Powershell\",\"reboot\",\"reboot alert\",\"Redeploy\",\"scheduled event alert\",\"Scheduled Events\"],\"articleSection\":[\"Azure\",\"Log Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/\",\"url\":\"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/\",\"name\":\"Get Azure Scheduled Events with IMDS - ciraltos\",\"isPartOf\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#website\"},\"datePublished\":\"2021-02-10T00:55:09+00:00\",\"dateModified\":\"2023-03-23T11:43:31+00:00\",\"description\":\"In this video, we get scheduled events for an Azure virtual machine by querying the Instance Metadata service API endpoint.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.ciraltos.com\/staging2\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get Azure Scheduled Events with IMDS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#website\",\"url\":\"https:\/\/www.ciraltos.com\/staging2\/\",\"name\":\"ciraltos\",\"description\":\"cloud, technology and trends\",\"publisher\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.ciraltos.com\/staging2\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\",\"name\":\"Travis Roberts\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png\",\"contentUrl\":\"http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png\",\"width\":5657,\"height\":3563,\"caption\":\"Travis Roberts\"},\"logo\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.ciraltos.com\",\"https:\/\/twitter.com\/ciraltos\"],\"url\":\"http:\/\/www.ciraltos.com\/staging2\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Get Azure Scheduled Events with IMDS - ciraltos","description":"In this video, we get scheduled events for an Azure virtual machine by querying the Instance Metadata service API endpoint.","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.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/","og_locale":"en_US","og_type":"article","og_title":"Get Azure Scheduled Events with IMDS - ciraltos","og_description":"In this video, we get scheduled events for an Azure virtual machine by querying the Instance Metadata service API endpoint.","og_url":"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/","og_site_name":"ciraltos","article_published_time":"2021-02-10T00:55:09+00:00","article_modified_time":"2023-03-23T11:43:31+00:00","og_image":[{"width":142,"height":181,"url":"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Azure-Log-Analytics.png","type":"image\/png"}],"author":"Travis Roberts","twitter_card":"summary_large_image","twitter_creator":"@ciraltos","twitter_site":"@ciraltos","twitter_misc":{"Written by":"Travis Roberts","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/#article","isPartOf":{"@id":"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/"},"author":{"name":"Travis Roberts","@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"headline":"Get Azure Scheduled Events with IMDS","datePublished":"2021-02-10T00:55:09+00:00","dateModified":"2023-03-23T11:43:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/"},"wordCount":111,"commentCount":0,"publisher":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"keywords":["169.254.169.254","Azure","Azure Free","Azure Instance Metadata Service Instance Metadata Service","azure management","azure training","freeze","IMDS","Log Analytics","Powershell","reboot","reboot alert","Redeploy","scheduled event alert","Scheduled Events"],"articleSection":["Azure","Log Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/","url":"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/","name":"Get Azure Scheduled Events with IMDS - ciraltos","isPartOf":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#website"},"datePublished":"2021-02-10T00:55:09+00:00","dateModified":"2023-03-23T11:43:31+00:00","description":"In this video, we get scheduled events for an Azure virtual machine by querying the Instance Metadata service API endpoint.","breadcrumb":{"@id":"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.ciraltos.com\/staging2\/get-azure-scheduled-events-with-imds\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.ciraltos.com\/staging2\/"},{"@type":"ListItem","position":2,"name":"Get Azure Scheduled Events with IMDS"}]},{"@type":"WebSite","@id":"https:\/\/www.ciraltos.com\/staging2\/#website","url":"https:\/\/www.ciraltos.com\/staging2\/","name":"ciraltos","description":"cloud, technology and trends","publisher":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.ciraltos.com\/staging2\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a","name":"Travis Roberts","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/","url":"http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png","contentUrl":"http:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png","width":5657,"height":3563,"caption":"Travis Roberts"},"logo":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.ciraltos.com","https:\/\/twitter.com\/ciraltos"],"url":"http:\/\/www.ciraltos.com\/staging2\/author\/admin\/"}]}},"_links":{"self":[{"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/1970"}],"collection":[{"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/comments?post=1970"}],"version-history":[{"count":3,"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/1970\/revisions"}],"predecessor-version":[{"id":3876,"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/1970\/revisions\/3876"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/media\/3872"}],"wp:attachment":[{"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/media?parent=1970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/categories?post=1970"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/tags?post=1970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}