<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>automation Archives - Apostolidis Cloud Corner</title>
	<atom:link href="https://www.cloudcorner.gr/tag/automation/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.cloudcorner.gr/tag/automation/</link>
	<description>Remarks from a Cloud Architect encounters</description>
	<lastBuildDate>Tue, 24 Oct 2023 08:44:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://www.cloudcorner.gr/wp-content/uploads/2021/04/cropped-cloudcorner2-32x32.png</url>
	<title>automation Archives - Apostolidis Cloud Corner</title>
	<link>https://www.cloudcorner.gr/tag/automation/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Azure Policy to enable network policies for private endpoints</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/azure-policy-to-enable-network-policies-for-private-endpoints/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/azure-policy-to-enable-network-policies-for-private-endpoints/#respond</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Thu, 23 Feb 2023 07:57:49 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[IaC]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure policy]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[compliance]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[security]]></category>
		<guid isPermaLink="false">https://www.cloudcorner.gr/?p=4003</guid>

					<description><![CDATA[<p>Network security policies are a very handy feature when you use Private Endpoints on Azure. If you enable network security</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-policy-to-enable-network-policies-for-private-endpoints/">Azure Policy to enable network policies for private endpoints</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Network security policies are a very handy feature when you use Private Endpoints on Azure. If you enable network security policies for User-Defined Routes, the /32 routes that are generated by the private endpoint and propagated to all the subnets in its own VNet and directly peered VNets will be invalidated if you have User-Defined Routing, which is useful if you want all traffic (including traffic addressed to the private endpoint) to go through a firewall, since otherwise, the /32 route would bypass any other route.</p>



<p>By default, network policies are disabled for a subnet in a virtual network and you need to enable it manually, from the Azure Portal after the VNET creation, or you need to specify it in your script if you are deploying with PowerShell, Cli, Bicep or any other IaC. </p>



<p>To ensure that Network security policies are enabled, and force enable it, we can use an Azure Policy. The below Azure Policy checks if the Network security policies are enabled, and if not it automatically enables it. The result of this policy is:</p>



<ul class="wp-block-list">
<li>for new Virtual Networks, it automatically enables Network security policies to all subnets, even if you forgot to select it upon the creation</li>



<li>for existing virtual Network subnets, it uses a remediation plan to evaluate and enable the Network security policies.</li>
</ul>



<p>The Policy:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="json" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">{
  "mode": "All",
  "policyRule": {
    "if": {
      "field": "Microsoft.Network/virtualNetworks/subnets[*].privateEndpointNetworkPolicies",
      "notEquals": "Enabled"
    },
    "then": {
      "effect": "modify",
      "details": {
        "roleDefinitionIds": [
          "/providers/Microsoft.Authorization/roleDefinitions/4d97b98b-1d4f-4787-a291-c67834d212e7"
        ],
        "operations": [
          {
            "operation": "addOrReplace",
            "field": "Microsoft.Network/virtualNetworks/subnets[*].privateEndpointNetworkPolicies",
            "value": "Enabled"
          }
        ]
      }
    }
  },
  "parameters": {}
}</pre>



<p>To add the Policy to your Azure environment:</p>



<ul class="wp-block-list">
<li>Go to the Azure Policy Definitions blade (shortcut: <a href="https://portal.azure.com/#view/Microsoft_Azure_Policy/PolicyMenuBlade/~/Definitions">Policy &#8211; Microsoft Azure</a> )</li>



<li>Add Policy Definition </li>
</ul>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2023/02/image.png"><img decoding="async" width="138" height="37" src="https://www.cloudcorner.gr/wp-content/uploads/2023/02/image.png" alt="" class="wp-image-4004"/></a></figure>



<ul class="wp-block-list">
<li>Provide a location (subscription) to save the policy object, and give a name and a category. Use the existing Network category.</li>
</ul>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-1.png"><img fetchpriority="high" decoding="async" width="787" height="513" src="https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-1.png" alt="" class="wp-image-4005" srcset="https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-1.png 787w, https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-1-300x196.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-1-768x501.png 768w" sizes="(max-width: 787px) 100vw, 787px" /></a></figure>



<ul class="wp-block-list">
<li>Paste the policy Json</li>
</ul>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-2.png"><img decoding="async" width="790" height="590" src="https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-2.png" alt="" class="wp-image-4006" srcset="https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-2.png 790w, https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-2-300x224.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-2-768x574.png 768w" sizes="(max-width: 790px) 100vw, 790px" /></a></figure>



<ul class="wp-block-list">
<li>Select a Role Assignment. You need a role that will have editor access to the subnet. For my demo, I used the Network Contributor build-in role (4d97b98b-1d4f-4787-a291-c67834d212e7) for the action.</li>



<li>Once the Policy is created, open it and you need to assign it to a scope (MG, Subscription, Resource Group)</li>
</ul>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-3.png"><img loading="lazy" decoding="async" width="84" height="30" src="https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-3.png" alt="" class="wp-image-4007"/></a></figure>



<ul class="wp-block-list">
<li>Assign the policy to the scope you want, like Management Group, Subscription, or Resource Group and one thing that needs attention is to create a remediation task and a Managed Identity.</li>



<li>The remediation task is needed to remediate the existing resources and the Managed Identity for the modification action.</li>
</ul>



<figure class="wp-block-image size-full"><a href="https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-5.png"><img loading="lazy" decoding="async" width="767" height="554" src="https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-5.png" alt="" class="wp-image-4009" srcset="https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-5.png 767w, https://www.cloudcorner.gr/wp-content/uploads/2023/02/image-5-300x217.png 300w" sizes="auto, (max-width: 767px) 100vw, 767px" /></a></figure>



<p>The Policy is in Audit only mode, in case you just need to audit if there are any subnets that don&#8217;t have privateEndpointNetworkPolicies enabled.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="json" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">{
  "mode": "All",
  "policyRule": {
    "if": {
      "allOf": [
        {
          "field": "type",
          "equals": "Microsoft.Network/virtualNetworks/subnets"
        },
        {
          "field": "Microsoft.Network/virtualNetworks/subnets[*].privateEndpointNetworkPolicies",
          "notEquals": "Enabled"
        }
      ]
    },
    "then": {
      "effect": "audit"
    }
  },
  "parameters": {}
}</pre>



<p>You can get the Policy Json files at my Github repo: <a href="https://github.com/proximagr/automation#policy-audit---enable-network-policy-for-private-endpoints-blog-post">https://github.com/proximagr/automation#policy-audit&#8212;enable-network-policy-for-private-endpoints-blog-post</a></p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author"><div class="saboxplugin-tab"><div class="saboxplugin-gravatar"><img loading="lazy" decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div><div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div><div class="saboxplugin-desc"><div itemprop="description"><p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div></div><div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div><div class="clearfix"></div><div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:pr&#111;&#120;&#105;&#109;a&#103;r&#064;h&#111;&#116;&#109;&#097;&#105;&#108;&#046;com" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div></div></div><p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fazure-policy-to-enable-network-policies-for-private-endpoints%2F&amp;linkname=Azure%20Policy%20to%20enable%20network%20policies%20for%20private%20endpoints" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fazure-policy-to-enable-network-policies-for-private-endpoints%2F&amp;linkname=Azure%20Policy%20to%20enable%20network%20policies%20for%20private%20endpoints" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fazure-policy-to-enable-network-policies-for-private-endpoints%2F&#038;title=Azure%20Policy%20to%20enable%20network%20policies%20for%20private%20endpoints" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/azure-policy-to-enable-network-policies-for-private-endpoints/" data-a2a-title="Azure Policy to enable network policies for private endpoints"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-policy-to-enable-network-policies-for-private-endpoints/">Azure Policy to enable network policies for private endpoints</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure/azure-policy-to-enable-network-policies-for-private-endpoints/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Azure VM &#124; Add Multiple Data Disks v2</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/azure-vm-add-multiple-data-disks-v2/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/azure-vm-add-multiple-data-disks-v2/#comments</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Fri, 02 Jul 2021 08:26:54 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure vm]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[managed disks]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[windows server]]></category>
		<guid isPermaLink="false">http://ge08jfh8ds93sdf.azurewebsites.net/?p=3786</guid>

					<description><![CDATA[<p>This is a new version of my previous script Add multiple managed disks to Azure RM VM Changes: Shows the</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-vm-add-multiple-data-disks-v2/">Azure VM | Add Multiple Data Disks v2</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This is a new version of my previous script <a href="/microsoft/add-multiple-managed-disks-to-azure-rm-vm/">Add multiple managed disks to Azure RM VM</a></p>
<p>Changes:</p>
<ul>
<li style="list-style-type: none;">
<ul>
<li>Shows the disk capacity of the VM and asks how many disks to add.</li>
<li>Prompts for the size of every disk</li>
<li>Checks for empty Luns to add the disks</li>
</ul>
</li>
</ul>
<pre class="EnlighterJSRAW" data-enlighter-language="powershell"># 1. You need to login to the Azure Rm Account

Login-AzAccount

# 2. The script will query the Subscriptions that the login account has access and will promt the user to select the target Subscription from the drop down list
 
$subscription = Get-AzSubscription | Out-GridView -Title "Select a Subscription" -PassThru
Select-AzSubscription -SubscriptionId $subscription.Id

# 3. The script will query the available VMs and promt to select the target VM from the VM list
 
$vm = Get-AzVM | Out-GridView -Title "Select the Virtual Machine to add Data Disks to" -PassThru

# 4. I set the storage type based on the OS disk. If you want to spesify somehting else you can cahnge this to: $storageType = StandardLRS or PremiumLRS etc.

$storageType = $VM.StorageProfile.OsDisk.ManagedDisk.StorageAccountType

# 5. Enter how many data disks you need to create

$VMdiskCapacity = ($VM.StorageProfile.DataDisks).Capacity
 
$diskquantity = Read-Host "How many disks you need to create? Max Capacity" $VMdiskCapacity "."

# 6. The script will promt for disk size, in GB

$diskSizeList = @()
for($i = 1; $i -le $diskquantity; $i++)
{
    $disk = (Read-Host "Disk " $i " Size")
    $diskSizeList += $disk
}
$diskSizeList

# 7. check for exisiting disks

$existinglun = @()
for($i = 0; $i -lt $VMdiskCapacity; $i++) {
    $existinglun += ($VM.StorageProfile.DataDisks)[$i].Lun
}

# 8. disks creation

for($i = 0; $i -lt $diskquantity; $i++)
{
$diskName = $vm.Name + "-DataDisk-" + $i.ToString()
$diskConfig = New-AzDiskConfig -AccountType $storageType -Location $vm.Location -CreateOption Empty -DiskSizeGB $diskSizeList[$i]
$DataDisk = New-AzDisk -DiskName $diskName -Disk $diskConfig -ResourceGroupName $vm.ResourceGroupName
for ($j = 0; $j -lt $VMdiskCapacity; $j++) {
    if ( $null -eq $existinglun[$j] ) {
        $nextLunIndex
        for ($k = 0; $k -lt $VMdiskCapacity; $k++ ) {
            $nextLunIndex = $k
            for ( $m = 0; $m -lt $VMdiskCapacity; $m++ ) {
                if ( $k -eq $existinglun[$m] ) {
                    $nextLunIndex = -1 
                    break 
                }
            }
            if ($nextLunIndex -ne -1 ) {
                break
            }
        }
        Add-AzVMDataDisk -VM $vm -Name $DiskName -CreateOption Attach -ManagedDiskId $DataDisk.Id -Lun $nextLunIndex
        $existinglun[$j] = $nextLunIndex
        break
    } 
}
}
Update-AzVM -VM $vm -ResourceGroupName $vm.ResourceGroupName</pre>
<p>You can download the script from: <a href="https://github.com/proximagr/automation/blob/master/Add-DataDisks-DIffSize_v3.ps1">https://github.com/proximagr/automation/blob/master/Add-DataDisks-DIffSize_v3.ps1</a></p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author">
<div class="saboxplugin-tab">
<div class="saboxplugin-gravatar"><img loading="lazy" decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div>
<div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div>
<div class="saboxplugin-desc">
<div itemprop="description">
<p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div>
</div>
<div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div>
<div class="clearfix"></div>
<div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:&#112;r&#111;xi&#109;agr&#064;ho&#116;ma&#105;l&#046;&#099;&#111;&#109;" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div>
</div>
</div>
<p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fazure-vm-add-multiple-data-disks-v2%2F&amp;linkname=Azure%20VM%20%7C%20Add%20Multiple%20Data%20Disks%20v2" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fazure-vm-add-multiple-data-disks-v2%2F&amp;linkname=Azure%20VM%20%7C%20Add%20Multiple%20Data%20Disks%20v2" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fazure-vm-add-multiple-data-disks-v2%2F&#038;title=Azure%20VM%20%7C%20Add%20Multiple%20Data%20Disks%20v2" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/azure-vm-add-multiple-data-disks-v2/" data-a2a-title="Azure VM | Add Multiple Data Disks v2"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-vm-add-multiple-data-disks-v2/">Azure VM | Add Multiple Data Disks v2</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure/azure-vm-add-multiple-data-disks-v2/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Infrastructure as Code &#124; Deploy a VNET &#038; NSG &#038; UDR</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/#comments</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Wed, 11 Mar 2020 22:45:35 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[IaC]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure template]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[devops]]></category>
		<category><![CDATA[iac]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[network security group]]></category>
		<category><![CDATA[nsg]]></category>
		<category><![CDATA[route table]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[udr]]></category>
		<category><![CDATA[virtual network]]></category>
		<category><![CDATA[vnet]]></category>
		<guid isPermaLink="false">https://www.e-apostolidis.gr/?p=3297</guid>

					<description><![CDATA[<p>Infrastructure as Code &#124; Deploy a VNET with NSG and UDRs Infrastructure as Code, or just IaC, provides three three</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/">Infrastructure as Code | Deploy a VNET &#038; NSG &#038; UDR</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Infrastructure as Code | Deploy a VNET with NSG and UDRs</h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-3312" src="https://www.e-apostolidis.gr/wp-content/uploads/2020/03/IaC.png" alt="IaC" width="1095" height="838" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/03/IaC.png 1095w, https://www.cloudcorner.gr/wp-content/uploads/2020/03/IaC-300x230.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2020/03/IaC-1024x784.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2020/03/IaC-768x588.png 768w" sizes="auto, (max-width: 1095px) 100vw, 1095px" /></p>
<p>Infrastructure as Code, or just IaC, provides three three main advantages: cost reduction, faster execution and risk reduction, the attributes of the DevOps culture.</p>
<p style="text-align: justify;">Microsoft Azure Resource Manager allows the managing and provisioning of Azure Resources, that can be Virtual Machines, Virtual Networks, Storage Accounts, Apps, SQL Databases and everything that a computer data center includes, through machine-readable definition files, known as JSON templates, without the need of physical hardware configuration or interactive configuration tools.</p>
<p style="text-align: justify;">I am starting a series of posts about building infrastructure with JSON templates.</p>
<p style="text-align: justify;">The tool I use to build my Azure Json templates is the Visual Studio Code. You can download it from <a href="https://code.visualstudio.com/">https://code.visualstudio.com/</a> for every platform.</p>
<p style="text-align: justify;">To work with Azure Resource Manager you need the Azure Resource Manager Tools extension. Open the VS Code, go to the Extensions Section, search and install the Azure Resource Manager Tools extension.</p>
<p id="SEhVTIV"><img loading="lazy" decoding="async" class="alignnone wp-image-3306 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2020/03/img_5e695dd565ae7.png" alt="infrastructure as code" width="488" height="353" srcset="https://www.cloudcorner.gr/wp-content/uploads/2020/03/img_5e695dd565ae7.png 488w, https://www.cloudcorner.gr/wp-content/uploads/2020/03/img_5e695dd565ae7-300x217.png 300w" sizes="auto, (max-width: 488px) 100vw, 488px" /></p>
<p>The extension is very helpful since it highlights the code, it provides references and intellisense.</p>
<p>At this post I am sharing &amp; explaining my Azure json template for deploying a Virtual Network, a Network Security Group and a Route Table.</p>
<p>You can find and download my working template at <a href="https://github.com/proximagr" target="_blank" rel="noopener noreferrer">my Git account</a> :</p>
<p><a href="https://github.com/proximagr/ARMTemplates/tree/master/VNET-2sub-NSG-UDR" target="_blank" rel="noopener noreferrer">https://github.com/proximagr/ARMTemplates/tree/master/VNET-2sub-NSG-UDR</a></p>
<h3>Json Template Guide</h3>
<p>Below you can find my template with comments, for better understanding.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="json" data-enlighter-theme="droide">{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
//** Define the Virtual Network Name */
    "vnetName": {
      "type": "string",
      "defaultValue": "Cloud-Corner-VNET",
      "metadata": {
        "description": "Cloud Corner VNET"
      }
//** Define the Address Space of the Virtual Network */
    },
      "vnetAddressPrefix": {
        "type": "string",
        "defaultValue": "10.0.0.0/24",
        "metadata": {
          "description": "Address prefix"
        }
//** Define the Address Space of the the First Subnet */
      },
      "subnet1Prefix": {
        "type": "string",
        "defaultValue": "10.0.0.0/27",
        "metadata": {
          "description": "Subnet 1 Prefix"
        }
//** Define the Name of the the First Subnet */
      },
      "subnet1Name": {
        "type": "string",
        "defaultValue": "Subnet1",
        "metadata": {
          "description": "Subnet 1 Name"
        }
//** Define the Address Space of the the Second Subnet */
      },
      "subnet2Prefix": {
        "type": "string",
        "defaultValue": "10.0.0.32/27",
        "metadata": {
          "description": "Subnet 2 Prefix"
        }
//** Define the Name of the the First Subnet */
      },
      "subnet2Name": {
        "type": "string",
        "defaultValue": "Subnet2",
        "metadata": {
          "description": "Subnet 2 Name"
        }
      },
//** Define the Name of the the Network Security Group */
      "networkSecurityGroup01Name": {
        "type": "string",
        "defaultValue": "Cloud-Corner-NSG-01",
        "metadata": {
          "description": "This is the name of the network security group"
        }
      },
//** Define the Name of the the First Route Table */
      "RouteTable01Name": {
        "type": "string",
        "defaultValue": "Cloud-Corner-UDR-01",
        "metadata": {
        "description": "Route Table 01 Name."
        }
      },
//** Define the Name of the the First Route of the First Route Table */
      "Route01Name": {
        "type": "string",
        "defaultValue": "To-internet",
        "metadata": {
          "description": "Route 01 Name."
        }
      },
//** Define the Next Hop Type of the the First Route of the First Route Table */
      "Route01NextHopType": {
        "type": "string",
        "allowedValues": [
        "VirtualNetworkGateway",
        "VnetLocal",
        "Internet",
        "VirtualAppliance",
        "None"
      ],
      "defaultValue": "VirtualAppliance",
        "metadata": {
          "description": "Route 01 Next Hop Type."
        }
      },
//** Define the Address Prefix of the First Route of the First Route Table */
      "Route01AddressPrefix": {
        "type": "string",
        "defaultValue": "0.0.0.0/0",
        "metadata": {
          "description": "Route 01 Address Prefix."
        }
      },
//** If you set "Virtyal Appliance for Next Hop Type, then you need to define the Next Hop IP Address, */
//** meaning the appliance's IP address. Here you define it for the First Route of the First Route Table */
        "RT01Route01NextHopIPAddress": {
        "type": "string",
        "defaultValue": "10.0.0.40",
        "metadata": {
          "description": "Next Hop IP Addess."
        }
      },
//** Define the Name of the Second Route Table */
      "RouteTable02Name": {
        "type": "string",
        "defaultValue": "Cloud-Corner-UDR-02",
        "metadata": {
          "description": "Route Table 02 Name."
        }
      },
//** Define the Name of the the First Route of the Second Route Table */
      "RT02Route01Name": {
        "type": "string",
        "defaultValue": "Local-Subnet",
        "metadata": {
        "description": "Route Table 02 Route 01 Name."
        }
      },
//** Define the Next Hop Type of the the First Route of the Second Route Table */
      "RT02Route01NextHopType": {
        "type": "string",
        "allowedValues": [
        "VirtualNetworkGateway",
        "VnetLocal",
        "Internet",
        "VirtualAppliance",
        "None"
      ],
      "defaultValue": "VnetLocal",
        "metadata": {
          "description": "Route 02 Next Hop Type."
        }
      },
//** Define the Address Prefix of the the First Route of the Second Route Table */
      "RT02Route01AddressPrefix": {
        "type": "string",
        "defaultValue": "10.0.0.0/27",
        "metadata": {
          "description": "Route Table 02 Route 01 Address Prefix."
        }
      },
//** Define the Name of the the Second Route of the Second Route Table */
        "RT02Route02Name": {
          "type": "string",
          "defaultValue": "To-subnet-1",
          "metadata": {
            "description": "Route Table 02 Route 01 Name."
          }
        },
//** Define the Next Hop Type of the the Second Route of the Second Route Table */
        "RT02Route02NextHopType": {
          "type": "string",
          "allowedValues": [
          "VirtualNetworkGateway",
          "VnetLocal",
          "Internet",
          "VirtualAppliance",
          "None"
        ],
        "defaultValue": "VirtualAppliance",
          "metadata": {
            "description": "Route 02 Next Hop Type."
          }
        },
//** Define the address prefix of the the Second Route of the Second Route Table */
        "RT02Route02AddressPrefix": {
          "type": "string",
          "defaultValue": "10.0.0.32/27",
          "metadata": {
            "description": "Route Table 02 Route 01 Address Prefix."
          }
      },
//** Define the next hop IP address (the virtual appliance's address) of the the Second Route of the Second Route Table */
        "RT02Route02NextHopIPAddress": {
          "type": "string",
          "defaultValue": "10.0.0.40",
          "metadata": {
            "description": "Next Hop IP Addess."
          }
        }
    },
//** I dont use any variables, you can exclude this section*/
  "variables": {},
  "resources": [
//* create the First Route Table &amp; Route*/
    {
    "apiVersion": "2017-10-01",
    "type": "Microsoft.Network/routeTables",
    "name": "[parameters('RouteTable01Name')]",
    "location": "[resourceGroup().location]",
    "properties": {
    "disableBgpRoutePropagation": true,
    "routes": [
      {
        "name": "[parameters('Route01Name')]",
        "properties": {
          "addressPrefix": "[parameters('Route01AddressPrefix')]",
          "nextHopType": "[parameters('Route01NextHopType')]",
          "nextHopIpAddress": "[parameters('RT01Route01NextHopIPAddress')]"
          }
        }
      ]
    }
  },
//* create the Second Route Table &amp; Routes*/
    {
    "apiVersion": "2017-10-01",
    "type": "Microsoft.Network/routeTables",
    "name": "[parameters('RouteTable02Name')]",
    "location": "[resourceGroup().location]",
    "properties": {
    "disableBgpRoutePropagation": true,
    "routes": [
      {
        "name": "[parameters('RT02Route01Name')]",
        "properties": {
          "addressPrefix": "[parameters('RT02Route01AddressPrefix')]",
          "nextHopType": "[parameters('RT02Route01NextHopType')]"
        }
      },
          {
        "name": "[parameters('RT02Route02Name')]",
        "properties": {
          "addressPrefix": "[parameters('RT02Route02AddressPrefix')]",
          "nextHopType": "[parameters('RT02Route02NextHopType')]",
          "nextHopIpAddress": "[parameters('RT02Route02NextHopIPAddress')]"
          }
        }
      ]
    }
  },
//* create teh Network Security Group */
    {
    "apiVersion": "2019-02-01",
    "type": "Microsoft.Network/networkSecurityGroups",
    "name": "[parameters('networkSecurityGroup01Name')]",
    "location": "[resourceGroup().location]",
    "properties": {
      "securityRules": [
        {
          "name": "HTTPS",
          "properties": {
            "description": "Open HTTPS to Public",
            "protocol": "Tcp",
            "sourcePortRange": "443",
            "destinationPortRange": "443",
            "sourceAddressPrefix": "*",
            "destinationAddressPrefix": "*",
            "access": "Allow",
            "priority": 101,
            "direction": "Inbound"
            }
          }
        ]
      }
    },
//* create the Virtual Network */
    {
      "apiVersion": "2018-10-01",
      "type": "Microsoft.Network/virtualNetworks",
      "name": "[parameters('vnetName')]",
      "location": "[resourceGroup().location]",
//*add a dependency in order to ensure that the NSG is created before the VNET, in order to be able to attach it*/
      "dependsOn": [
        "[parameters('networkSecurityGroup01Name')]"
      ],
      "properties": {
        "AddressSpace": {
          "AddressPrefixes": [
            "[parameters('vnetAddressPrefix')]"
          ]
        }
      },
      "resources": [
//* create the first subnet */
        {
        "apiVersion": "2018-10-01",
        "type": "subnets",
        "location": "[resourceGroup().location]",
        "name": "[parameters('subnet1Name')]",
//* add dependencies to create the resources with an order, because you need to ensure that the VNET is ready before creating the Subnet and also the Route Table*/
        "dependsOn": [
          "[parameters('vnetName')]",
          "[resourceId('Microsoft.Network/routeTables', parameters('RouteTable01Name'))]"
        ],
        "properties": {
        "AddressPrefix": "[parameters('subnet1Prefix')]",
//*attach the Newtork Securoty Group to the Subnet*/
        "networkSecurityGroup": {
        "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroup01Name'))]"},
//*attacht the First route table to the Subnet*/
        "routeTable": {
        "id": "[resourceId('Microsoft.Network/routeTables', parameters('RouteTable01Name'))]"
          }
         }
        },
//*create the second subnet*/
        {
        "apiVersion": "2018-10-01",
        "type": "subnets",
        "location": "[resourceGroup().location]",
        "name": "[parameters('subnet2Name')]",
        "dependsOn": [
          "[parameters('vnetName')]",
          "[parameters('subnet1Name')]",
          "[parameters('RouteTable02Name')]"
        ],
        "properties": {
          "AddressPrefix": "[parameters('subnet2Prefix')]",
//*attach the Newtork Securoty Group to the Subnet*/
          "networkSecurityGroup": {
          "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroup01Name'))]"},
//*attacht the second route table to the Subnet*/
          "routeTable": {
          "id": "[resourceId('Microsoft.Network/routeTables', parameters('RouteTable02Name'))]"
            }
          }
        }
      ]
    }
  ]
}</pre>
<p>&nbsp;</p>
<h3>Deploy the template</h3>
<p><strong>Deploy the template directly from here:</strong></p>
<p><a href="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fproximagr%2FARMTemplates%2Fmaster%2FVNET-2sub-NSG-UDR%2Fazuredeploy.json" target="_blank" rel="noopener noreferrer"> <img decoding="async" src="https://aka.ms/deploytoazurebutton" /> </a></p>
<p>&nbsp;</p>
<p>More Azure Resource Manager Templates: <a href="https://www.e-apostolidis.gr/microsoft/create-azure-file-shares-using-arm-template-powershell/">https://www.e-apostolidis.gr/microsoft/azure/create-azure-file-shares-using-arm-template-powershell/</a></p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author">
<div class="saboxplugin-tab">
<div class="saboxplugin-gravatar"><img loading="lazy" decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div>
<div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div>
<div class="saboxplugin-desc">
<div itemprop="description">
<p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div>
</div>
<div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div>
<div class="clearfix"></div>
<div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:prox&#105;ma&#103;r&#064;&#104;&#111;tmai&#108;&#046;&#099;&#111;m" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div>
</div>
</div>
<p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Finfrastructure-as-code-deploy-a-vnet-nsg-udr%2F&amp;linkname=Infrastructure%20as%20Code%20%7C%20Deploy%20a%20VNET%20%26%20NSG%20%26%20UDR" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Finfrastructure-as-code-deploy-a-vnet-nsg-udr%2F&amp;linkname=Infrastructure%20as%20Code%20%7C%20Deploy%20a%20VNET%20%26%20NSG%20%26%20UDR" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Finfrastructure-as-code-deploy-a-vnet-nsg-udr%2F&#038;title=Infrastructure%20as%20Code%20%7C%20Deploy%20a%20VNET%20%26%20NSG%20%26%20UDR" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/" data-a2a-title="Infrastructure as Code | Deploy a VNET &amp; NSG &amp; UDR"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/">Infrastructure as Code | Deploy a VNET &#038; NSG &#038; UDR</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure/infrastructure-as-code-deploy-a-vnet-nsg-udr/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Azure VM Antimalware Extension Management</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/azure-vm-antimalware-extension-management/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/azure-vm-antimalware-extension-management/#comments</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Sun, 31 Mar 2019 18:23:13 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[antimalware]]></category>
		<category><![CDATA[antivirus]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[az]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azurevm]]></category>
		<category><![CDATA[defender]]></category>
		<category><![CDATA[microsoft antimalware]]></category>
		<category><![CDATA[microsoft defender]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tags]]></category>
		<guid isPermaLink="false">https://www.e-apostolidis.gr/?p=2387</guid>

					<description><![CDATA[<p>Azure VM Antimalware Extension Management Azure VM Antimalware Extension Management has always been a tricky subject. You can easily enable</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-vm-antimalware-extension-management/">Azure VM Antimalware Extension Management</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1 style="text-align: left;">Azure VM Antimalware Extension Management</h1>
<p style="text-align: justify;">Azure VM Antimalware Extension Management has always been a tricky subject. You can easily enable the Microsoft Antimalware Extension from the Azure Portal upon the Azure VM creation or by using the Extensions blade. But after that, the management of the extension is somehow tricky. There is no way to manage the Microsoft Antimalware exclusion list and auto-scan setting from the portal or from inside the VM. Even using PowerShell there is not a single command to manage the Microsoft Antimalware settings.</p>
<p style="text-align: justify;">There is no need to point out that all VMs must have an Endpoint Protection Solution. Azure provides the ability to add an Endpoint Protection Solution to all Azure VMs. Microsoft Antimalware for Azure Virtual Machines is a real-time protection capability that helps identify and remove viruses, spyware, and other malicious software, with configurable alerts when known malicious or unwanted software attempts to install itself or run on your system and it is absolutely free. For the 3rd party extensions you need to add your key.</p>
<p style="text-align: justify;">For Windows Server VMs up to version 2012 R2, the extension will install the System Center Endpoint Protection client and apply the configuration policies. Windows Server 2016 and above have build-in the Windows Defender, so the extension will only apply the configuration.</p>
<p>Below we will walk through on how to deploy &amp; manage the Microsoft Antimalware Extension Using the <strong><a href="#portal">Azure Portal (Single VM)</a>, </strong>Using the <strong><a href="#asc">Azure Security Center (Multiple VMs)</a></strong>and Using <strong><a href="#singlevm">PowerShell for a Single VM</a></strong>and <strong><a href="#multivmrg">for Multiple VMs filtered by Resource Groups </a></strong>or <strong><a href="#multivmtags">Tags</a>.</strong></p>
<h2 style="text-align: justify;">Deploy the Microsoft Antimalware Extension</h2>
<h3 style="text-align: justify;"><a id="portal"></a>Using the Azure Portal for single VM deployment</h3>
<p style="text-align: justify;">Go to the Azure VM&#8217;s blade, navigate to the Extensions section and press Add.</p>
<p id="TEeDKhy" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2499 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0ed33ac441.png" alt="microsoft antimalware" width="743" height="475" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ed33ac441.png 743w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ed33ac441-300x192.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ed33ac441-600x384.png 600w" sizes="auto, (max-width: 743px) 100vw, 743px" /></p>
<p style="text-align: justify;">Select the Microsoft Antimalware extension and press Create</p>
<p id="tirjqKm" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2500 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0ed79238b1.png" alt="microsoft antimalware" width="628" height="247" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ed79238b1.png 628w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ed79238b1-300x118.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ed79238b1-600x236.png 600w" sizes="auto, (max-width: 628px) 100vw, 628px" /></p>
<p style="text-align: justify;">Fill the &#8220;Install extension&#8221; form as desired and press OK. Here we can set the exclusions and the scan  type and schedule.</p>
<p id="ureoQSb" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2501 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0eddcbfa5d.png" alt="microsoft antimalware" width="581" height="900" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0eddcbfa5d.png 581w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0eddcbfa5d-194x300.png 194w" sizes="auto, (max-width: 581px) 100vw, 581px" /></p>
<h2 style="text-align: justify;"><a id="asc"></a>Using the Azure Security Center for multi VM deployment</h2>
<p style="text-align: justify;">Go to the Azure Security Center, navigate to &#8220;Compute &amp; Apps&#8221; and click &#8220;Install endpoint protection solution on virtual machines&#8221;</p>
<p id="lzlorCc" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2503 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0ef8a831e5.png" alt="microsoft antimalware" width="689" height="625" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ef8a831e5.png 689w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ef8a831e5-300x272.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0ef8a831e5-600x544.png 600w" sizes="auto, (max-width: 689px) 100vw, 689px" /></p>
<p style="text-align: justify;">The Azure Security Center will check which VMs does not have Endpoint Protection and will check them all. Press &#8220;Install on # VMs&#8221; to select the extension</p>
<p id="lRCNkXB" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2504 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0f16488ced.png" alt="microsoft antimalware" width="624" height="533" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0f16488ced.png 624w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0f16488ced-300x256.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0f16488ced-600x513.png 600w" sizes="auto, (max-width: 624px) 100vw, 624px" /></p>
<p style="text-align: justify;">Select &#8220;Microsoft Antimalware&#8221; and press create</p>
<p id="pmQCFtC" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2505 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0f1b89bcd7.png" alt="microsoft antimalware" width="559" height="126" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0f1b89bcd7.png 559w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0f1b89bcd7-300x68.png 300w" sizes="auto, (max-width: 559px) 100vw, 559px" /></p>
<p style="text-align: justify;">Fill the &#8220;Install extension&#8221; form as desired and press OK. Here we can set the exclusions and the scan  type and schedule.</p>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2501 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0eddcbfa5d.png" alt="microsoft antimalware" width="581" height="900" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0eddcbfa5d.png 581w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0eddcbfa5d-194x300.png 194w" sizes="auto, (max-width: 581px) 100vw, 581px" /></p>
<h2 style="text-align: justify;">Using the PowerShell for single and multi VM deployments</h2>
<h3 style="text-align: justify;"><a id="singlevm"></a>Single VM</h3>
<p style="text-align: justify;">Declare the variables</p>
<pre class="lang:ps decode:true ">$ResourceGroupName = "devrg"
$VMName = "devrgvm"
$Location = "West Europe"
$PublisherName = "Microsoft.Azure.Security"
$Type = "IaaSAntimalware"</pre>
<p style="text-align: justify;">Get the latest major version</p>
<pre class="lang:ps decode:true">#view all versions for the West Europe location
Get-AzVMExtensionImage -Location $Location -PublisherName $PublisherName -Type $Type | fl Version
#view the latest major version
((Get-AzVMExtensionImage -Location $Location -PublisherName $PublisherName -Type $Type).Version[-1][0..2] -join '')
#add the latest major version in a variable called "amversion"
$amversion = ((Get-AzVMExtensionImage -Location $Location -PublisherName $PublisherName -Type $Type).Version[-1][0..2] -join '')</pre>
<p style="text-align: justify;">Set the Microsoft Antimalware Settings, exclusions and schedules</p>
<pre class="lang:ps decode:true">$amsettings = @'
{
    "AntimalwareEnabled": true,
    "RealtimeProtectionEnabled": true,
    "ScheduledScanSettings": {
        "isEnabled": true,
        "day": 7,
        "time": 120,
        "scanType": "Quick"
    },
    "Exclusions": {
        "Extensions": ".log;.ldf",   
        "Paths": "D:\\IISlogs;D:\\DatabaseLogs",
        "Processes": "mssence.svc"
    }
}
'@</pre>
<h3 style="text-align: justify;">Enable the Microsoft Antimalware Extension at one Azure VM</h3>
<pre class="lang:ps decode:true">Set-AzVMExtension -ResourceGroupName $ResourceGroupName -VMName $VMName -Name $Type -Publisher $PublisherName -ExtensionType $Type -SettingString $amsettings -Location $Location -TypeHandlerVersion $amversio -ResourceGroupName $ResourceGroupName -VMName $Name -Name $Type -Publisher $PublisherName -ExtensionType $Type -SettingString $amsettings -Location $Location -TypeHandlerVersion $amversio</pre>
<p style="text-align: justify;">The whole scipt</p>
<pre class="lang:ps decode:true">Login-AzAccount
#variables
$ResourceGroupName = "devrg"
$VMName = "devrgvm"
$Location = "West Europe"
$PublisherName = "Microsoft.Azure.Security"
$Type = "IaaSAntimalware"
#Get the latest major version
$amversion = ((Get-AzVMExtensionImage -Location $Location -PublisherName $PublisherName -Type $Type).Version[-1][0..2] -join '')
#Antimalware extension settings, exclusions and schedules
$amsettings = @'
{
    "AntimalwareEnabled": true,
    "RealtimeProtectionEnabled": true,
    "ScheduledScanSettings": {
        "isEnabled": true,
        "day": 7,
        "time": 120,
        "scanType": "Quick"
    },
    "Exclusions": {
        "Extensions": ".log;.ldf",   
        "Paths": "D:\\IISlogs;D:\\DatabaseLogs",
        "Processes": "mssence.svc"
    }
}
'@
#enable the Microsoft Antimalware Extension with the above settings
Set-AzVMExtension -ResourceGroupName $ResourceGroupName -VMName $VMName -Name $Type -Publisher $PublisherName -ExtensionType $Type -SettingString $amsettings -Location $Location -TypeHandlerVersion $amversion</pre>
<h3 style="text-align: justify;"><a id="multivmrg"></a>Multi VM &#8211; All VMs in a Resource Group</h3>
<p style="text-align: justify;">To deploy the extension to multiple VMs use the &#8220;For Each-Object&#8221; loop, like this:</p>
<pre class="lang:ps decode:true ">#enable the Microsoft Antimalware Extension with the above settings to all VMs in the Resource Group
Get-AzVM -ResourceGroupName $ResourceGroupName | ForEach-Object {
    Set-AzVMExtension -ResourceGroupName $_.ResourceGroupName -VMName $_.Name -Name $Type -Publisher $PublisherName -ExtensionType $Type -SettingString $amsettings -Location $_.Location -TypeHandlerVersion $amversion
    }</pre>
<p style="text-align: justify;">The whole script</p>
<pre class="lang:ps decode:true">#Login-AzAccount
#variables
$Location = "West Europe"
$PublisherName = "Microsoft.Azure.Security"
$Type = "IaaSAntimalware"
#Get the latest major version
$amversion = ((Get-AzVMExtensionImage -Location $Location -PublisherName $PublisherName -Type $Type).Version[-1][0..2] -join '')
#Antimalware extension settings, exclusions and schedules
$amsettings = @'
{
    "AntimalwareEnabled": true,
    "RealtimeProtectionEnabled": true,
    "ScheduledScanSettings": {
        "isEnabled": true,
        "day": 7,
        "time": 120,
        "scanType": "Quick"
    },
    "Exclusions": {
        "Extensions": ".log;.ldf",   
        "Paths": "D:\\IISlogs;D:\\DatabaseLogs",
        "Processes": "mssence.svc"
    }
}
'@
#enable the Microsoft Antimalware Extension with the above settings to all VMs in the Resource Group
Get-AzVM -ResourceGroupName $ResourceGroupName | ForEach-Object {
    Set-AzVMExtension -ResourceGroupName $_.ResourceGroupName -VMName $_.Name -Name $Type -Publisher $PublisherName -ExtensionType $Type -SettingString $amsettings -Location $_.Location -TypeHandlerVersion $amversion
    }</pre>
<h2 style="text-align: justify;"><a id="multivmtags"></a>Using Tags instead of Resource Group to filter the VMs</h2>
<pre class="lang:ps decode:true ">Login-AzAccount
#variables (filter by tags)
$tagName = "Service"
$tagValue = "dev"
$Location = "West Europe"
$PublisherName = "Microsoft.Azure.Security"
$Type = "IaaSAntimalware"
#Get the latest major version
$amversion = ((Get-AzVMExtensionImage -Location $Location -PublisherName $PublisherName -Type $Type).Version[-1][0..2] -join '')
#Antimalware extension settings, excusions and schedules
$amsettings = @'
{
    "AntimalwareEnabled": true,
    "RealtimeProtectionEnabled": true,
    "ScheduledScanSettings": {
        "isEnabled": true,
        "day": 7,
        "time": 120,
        "scanType": "Quick"
    },
    "Exclusions": {
        "Extensions": ".log;.ldf",   
        "Paths": "D:\\IISlogs;D:\\DatabaseLogs",
        "Processes": "mssence.svc"
    }
}
'@
#enable the Microsoft Antimalware Extension with the above settings to all VMs of a spesific Tag
$tagResList = Get-AzResource -TagName $tagName -TagValue $tagValue
foreach($tagRes in $tagResList) { 
    Set-AzVMExtension -ResourceGroupName $tagRes.ResourceGroupName -VMName $tagRes.Name -Name $Type -Publisher $PublisherName -ExtensionType $Type -SettingString $amsettings -Location $tagRes.Location -TypeHandlerVersion $amversion
    }</pre>
<p style="text-align: justify;">After a successful deployment, at the VMs extensions, you will see an IaaS Antimalware extension with status &#8220;Provisioning succeeded&#8221;</p>
<p id="qBfxdXr" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2508 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/03/img_5ca0fc70cd676.png" alt="microsoft antimalware" width="1217" height="457" srcset="https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0fc70cd676.png 1217w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0fc70cd676-300x113.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0fc70cd676-768x288.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0fc70cd676-1024x385.png 1024w, https://www.cloudcorner.gr/wp-content/uploads/2019/03/img_5ca0fc70cd676-600x225.png 600w" sizes="auto, (max-width: 1217px) 100vw, 1217px" /></p>
<h2 style="text-align: justify;">Change the settings in an existing deployment</h2>
<p style="text-align: justify;">After the first deployment / installation, to change any settings of the WIndows Defender  / Forefront Endpoint Protection, we need to run the same PowerShell after changing the required settings at the &#8220;#Antimalware extension settings, exclusions and schedules&#8221; section</p>
<p style="text-align: left;">Reference: https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/iaas-antimalware-windows</p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author">
<div class="saboxplugin-tab">
<div class="saboxplugin-gravatar"><img loading="lazy" decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div>
<div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div>
<div class="saboxplugin-desc">
<div itemprop="description">
<p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div>
</div>
<div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div>
<div class="clearfix"></div>
<div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:p&#114;&#111;&#120;imag&#114;&#064;hot&#109;&#097;&#105;&#108;.&#099;&#111;&#109;" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div>
</div>
</div>
<p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fazure-vm-antimalware-extension-management%2F&amp;linkname=Azure%20VM%20Antimalware%20Extension%20Management" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fazure-vm-antimalware-extension-management%2F&amp;linkname=Azure%20VM%20Antimalware%20Extension%20Management" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fazure-vm-antimalware-extension-management%2F&#038;title=Azure%20VM%20Antimalware%20Extension%20Management" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/azure-vm-antimalware-extension-management/" data-a2a-title="Azure VM Antimalware Extension Management"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-vm-antimalware-extension-management/">Azure VM Antimalware Extension Management</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure/azure-vm-antimalware-extension-management/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Serverless Computing &#124; Check your expired public certificates</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/serverless-computing-check-your-expired-public-certificates/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/serverless-computing-check-your-expired-public-certificates/#respond</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Fri, 12 Oct 2018 09:41:29 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure function apps]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[serverless]]></category>
		<guid isPermaLink="false">https://www.e-apostolidis.gr/?p=2220</guid>

					<description><![CDATA[<p>Serverless Computing &#124; Check your expired public certificates Check for expired public certificates serverless, using an Azure Function App. Magically</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/serverless-computing-check-your-expired-public-certificates/">Serverless Computing | Check your expired public certificates</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1 style="text-align: justify;">Serverless Computing | Check your expired public certificates</h1>
<p style="text-align: justify;">Check for expired public certificates serverless, using an Azure Function App. Magically run the required PowerShell script directly at the Portal without deploying VMs or App Services. At this post I combine Azure Function Apps, with a PowerShell script to check the certificate expirations and the Send-MailMessage PowerShell function for sending emails directly from the PowerShell script.</p>
<h2 style="text-align: justify;">Setup the Azure Function App</h2>
<p style="text-align: justify;">At the Azure Portal, create a new Function App. Select Consumption Plan and .NET Runtime Stack</p>
<p id="MXzlFhG" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2226 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bbfa628f28d7.png" alt="Azure Function App" width="565" height="798" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa628f28d7.png 565w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa628f28d7-212x300.png 212w" sizes="auto, (max-width: 565px) 100vw, 565px" /></p>
<p style="text-align: justify;">Once the Function App is created, we need to enable PowerShell language support. To do so, open it, select the Function App and at the Platform features tab, open the Application Settings</p>
<p id="OhAViFR" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2228 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bbfa72059c9c.png" alt="Azure Function App" width="758" height="371" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa72059c9c.png 758w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa72059c9c-300x147.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa72059c9c-600x294.png 600w" sizes="auto, (max-width: 758px) 100vw, 758px" /></p>
<p style="text-align: justify;">Change the FUNCTIONS_EXTENSION_VERSION to ~1 and delete the FUNCTIONS_WORKER_RUNTIME line</p>
<p style="text-align: justify;">Before:</p>
<p id="xEnrOsO" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2230 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bbfa7f11745d.png" alt="Azure Function App" width="715" height="296" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa7f11745d.png 715w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa7f11745d-300x124.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa7f11745d-600x248.png 600w" sizes="auto, (max-width: 715px) 100vw, 715px" /></p>
<p style="text-align: justify;">After:</p>
<p id="SIlnSos" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2231 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bbfa85190469.png" alt="Azure Function App" width="746" height="301" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa85190469.png 746w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa85190469-300x121.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa85190469-600x242.png 600w" sizes="auto, (max-width: 746px) 100vw, 746px" /></p>
<h2 style="text-align: justify;">Create the Function</h2>
<p style="text-align: justify;">Once you click Save, go back to the Function App, select the &#8220;Functions&#8221; and press &#8220;New function&#8221;</p>
<p id="hCPzlED" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2232 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bbfa883c7ab5.png" alt="Azure Function App" width="798" height="361" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa883c7ab5.png 798w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa883c7ab5-300x136.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa883c7ab5-768x347.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa883c7ab5-600x271.png 600w" sizes="auto, (max-width: 798px) 100vw, 798px" /></p>
<p style="text-align: justify;">If we change the application settings correctly, the &#8220;Experimental Language Support&#8221; option will appear. Enable it and the templates will be able to support PowerShell (And more languages). To get started click the &#8220;Time trigger&#8221; template.</p>
<p id="FMRGdTd" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2233 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bbfa8d95fe43.png" alt="Azure Function App" width="825" height="314" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa8d95fe43.png 825w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa8d95fe43-300x114.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa8d95fe43-768x292.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa8d95fe43-600x228.png 600w" sizes="auto, (max-width: 825px) 100vw, 825px" /></p>
<p style="text-align: justify;">At the window, select &#8220;PowerShell&#8221; for language and set the schedule. &#8220;Enter a cron expression of the format &#8216;{second} {minute} {hour} {day} {month} {day of week}&#8217; to specify the schedule.&#8221;</p>
<p style="text-align: justify;">Entering 0 0 0 1 * * the function will run once per day</p>
<p id="igDGJif" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2234 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bbfa9c9bedcd.png" alt="Azure Function App" width="547" height="574" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa9c9bedcd.png 547w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bbfa9c9bedcd-286x300.png 286w" sizes="auto, (max-width: 547px) 100vw, 547px" /></p>
<h2 style="text-align: justify;">Add the PowerShell script</h2>
<p style="text-align: justify;">Once the Function is created, you will be directed to the &#8220;Function Name&#8221; run.ps1 file. There we can run PowerShell scripts.</p>
<p id="RlvLXyc" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2235 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bc06384d99f4.png" alt="Azure Function App" width="842" height="505" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bc06384d99f4.png 842w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bc06384d99f4-300x180.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bc06384d99f4-768x461.png 768w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bc06384d99f4-600x360.png 600w" sizes="auto, (max-width: 842px) 100vw, 842px" /></p>
<p style="text-align: justify;">Below is the script, change the required variables to fit your needs and paste it to the Function run.ps1 file. The variables that you need to change is:</p>
<p style="text-align: justify;">$WebsiteURLs | This is the list, comma separated, of the URLs you want to check for certificate expiration<br />
$From | The email address of the Sender<br />
$To | The email address of the Recipient<br />
$Cc | The email address of the CC Recipient<br />
$Subject | The subject of the email<br />
$SMTPServer | The email server you will use to send the emails. You can Use the SendGrid service from Azure that currenlty provides 25000 email per month for free. More details here: <a href="http://guidestomicrosoft.com/2016/02/17/configure-a-smtp-server-in-azure/">https://sendgrid.com/docs/API_Reference/SMTP_API/getting_started_smtp.html </a><br />
$SMTPPort | The port that the SMTP service requires<br />
$username | The username to authenticate to the SMTP Service<br />
$password = ConvertTo-SecureString &#8220;here you need to add the password in plain text&#8221; -AsPlainText -Force</p>
<pre class="lang:ps decode:true">$WebsiteURLs= @("e-apostolidis.gr","azureheads.gr")
$WebsitePort=443
$Threshold=120
$Severe=30
$ID=0

$body +=  "&lt;html&gt;&lt;body&gt;&lt;br&gt;"
$body +=  "&lt;font color =""darkblue""&gt;"
$body += "#	Website_URL:	Current Certificate:	Expiration Date:	Days Remaining:	Errors:"
foreach ($WebsiteURL in $WebsiteURLs){
$CommonName=$WebsiteURL
$ID+=1
Try{
$Conn = New-Object System.Net.Sockets.TcpClient($WebsiteURL,$WebsitePort) 
Try {
$Stream = New-Object System.Net.Security.SslStream($Conn.GetStream(),$false, {
param($sender, $certificate, $chain, $sslPolicyErrors) 
return $true
})
$Stream.AuthenticateAsClient($CommonName) 

$Cert = $Stream.Get_RemoteCertificate()
$CN=(($cert.Subject -split "=")[1] -split ",")[0]
$ValidTo = [datetime]::Parse($Cert.GetExpirationDatestring())

$ValidDays = $($ValidTo - [datetime]::Now).Days
if ($ValidDays -lt $Threshold) {
$fontcolor +=  "&lt;font color =darkgreen&gt;"
} 
if ($ValidDays -lt $Severe) {
$fontcolor +=  "&lt;font color =darkred&gt;"
}
$body += "&lt;br /&gt;"
$body += $fontcolor
$body += "$ID	$WebsiteURL	$CN	$ValidTo	$ValidDays"
}
Catch { Throw $_ }
Finally { $Conn.close() }
}
Catch {
$body += "&lt;br /&gt;"
$body +="&lt;font color=red&gt; gest &lt;/font&gt;"
$body += " $ID	$WebsiteURL"
$body +=  "&lt;/body&gt;&lt;/html&gt;"
}

}

$From = "alias@domain.gr"
$To = "alias@domain.gr"
$Cc = "alias@domain.gr"
$Subject = "check the certificates"

$SMTPServer = "mail.mailserver.gr"
$SMTPPort = "587"


$username = "username"
$password = ConvertTo-SecureString "password" -AsPlainText -Force
$mycred = New-Object System.Management.Automation.PSCredential($username, $password)
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { return $true }
Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject -SmtpServer $SMTPServer -UseSSL -port $SMTPPort -Credential ($mycred) -Body $body -BodyAsHtml</pre>
<p style="text-align: justify;">Press SAve &amp; Run and you are ready. Now on, once per day the script will run and it will sent an email with the certificates. Something like this:</p>
<p id="fYgDHmV" style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-2236 size-full" src="https://www.e-apostolidis.gr/wp-content/uploads/2018/10/img_5bc0649bdf4ce.png" alt="Azure Function App" width="637" height="229" srcset="https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bc0649bdf4ce.png 637w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bc0649bdf4ce-300x108.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2018/10/img_5bc0649bdf4ce-600x216.png 600w" sizes="auto, (max-width: 637px) 100vw, 637px" /></p>
<p style="text-align: justify;">Feel free to play with the colors on the script. I have added Dark Green for the valid certificates and Red for those that is about to expire.</p>
<h2 style="text-align: justify;">Credits</h2>
<p style="text-align: justify;">Use this line to ignore the certificate check on the email server when sending the email</p>
<pre class="prettyprint prettyprinted"><span class="pun">[</span><span class="typ">System</span><span class="pun">.</span><span class="typ">Net</span><span class="pun">.</span><span class="typ">ServicePointManager</span><span class="pun">]::</span><span class="typ">ServerCertificateValidationCallback</span> <span class="pun">=</span> <span class="pun">{</span> <span class="kwd">return</span><span class="pln"> $true </span><span class="pun">}</span></pre>
<p style="text-align: justify;"><a href="https://social.technet.microsoft.com/Forums/windows/en-US/d9e9af2b-3bb9-4cb4-8046-dd0a092bc456/send-email-by-powershell?forum=winserverpowershell">https://social.technet.microsoft.com/Forums/windows/en-US/d9e9af2b-3bb9-4cb4-8046-dd0a092bc456/send-email-by-powershell?forum=winserverpowershell</a></p>
<p style="text-align: justify;">The basic script for checking for certificate revocation:</p>
<p style="text-align: justify;"><a href="https://isc.sans.edu/forums/diary/Assessing+Remote+Certificates+with+Powershell/20645/">https://isc.sans.edu/forums/diary/Assessing+Remote+Certificates+with+Powershell/20645/</a></p>
<p style="text-align: justify;">At his blog is the idea for sending emails with powershell with html:</p>
<p style="text-align: justify;"><a href="http://www.techtrek.io/send-automated-email-with-powershell/">http://www.techtrek.io/send-automated-email-with-powershell/</a></p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author">
<div class="saboxplugin-tab">
<div class="saboxplugin-gravatar"><img loading="lazy" decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div>
<div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div>
<div class="saboxplugin-desc">
<div itemprop="description">
<p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div>
</div>
<div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div>
<div class="clearfix"></div>
<div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:p&#114;&#111;x&#105;&#109;&#097;g&#114;&#064;&#104;&#111;&#116;mai&#108;&#046;c&#111;&#109;" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div>
</div>
</div>
<p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fserverless-computing-check-your-expired-public-certificates%2F&amp;linkname=Serverless%20Computing%20%7C%20Check%20your%20expired%20public%20certificates" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fserverless-computing-check-your-expired-public-certificates%2F&amp;linkname=Serverless%20Computing%20%7C%20Check%20your%20expired%20public%20certificates" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fserverless-computing-check-your-expired-public-certificates%2F&#038;title=Serverless%20Computing%20%7C%20Check%20your%20expired%20public%20certificates" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/serverless-computing-check-your-expired-public-certificates/" data-a2a-title="Serverless Computing | Check your expired public certificates"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/serverless-computing-check-your-expired-public-certificates/">Serverless Computing | Check your expired public certificates</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure/serverless-computing-check-your-expired-public-certificates/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Add multiple managed disks to Azure RM VM</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/add-multiple-managed-disks-to-azure-rm-vm/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/add-multiple-managed-disks-to-azure-rm-vm/#comments</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Fri, 08 Sep 2017 14:29:54 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[managed disks]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[windows server]]></category>
		<guid isPermaLink="false">https://www.e-apostolidis.gr/?p=1484</guid>

					<description><![CDATA[<p>Add multiple managed disks to Azure RM VM In this post I have created a PowerShell script to help add</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/add-multiple-managed-disks-to-azure-rm-vm/">Add multiple managed disks to Azure RM VM</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Add multiple managed disks to Azure RM VM</h1>
<p>In this post I have created a PowerShell script to help add multiple managed disks to an Azure RM Virtual Machine.</p>
<p>The script to add multiple managed disks will prompt you to login to an Azure RM account, then it will query the subscriptions and ask you to select the desired. After that it will query the available VMs and promt to select the target VM from the VM list.</p>
<p>At this point I am checking the OS disk and define the storage type of the data disk. If we need to change the storage type we can check the comments at step 4. e.g. If the OS disk is Premium and you want Standard data disks.</p>
<p>The next step is to ask for disk size. You can check the sizes and billing here: <a href="https://docs.microsoft.com/en-us/azure/virtual-machines/windows/managed-disks-overview#pricing-and-billing">https://docs.microsoft.com/en-us/azure/virtual-machines/windows/managed-disks-overview#pricing-and-billing</a></p>
<p>Finally it will ask for the number of the disk we need to create. After this input the script will create the disks, attach them to the VM and update it.</p>
<h3>The Script:</h3>
<pre class="lang:ps decode:true "># 1. You need to login to the Azure Rm Account

Login-AzureRmAccount

# 2. The script will query the Subscriptions that the login account has access and will promt the user to select the target Subscription from the drop down list
 
$subscription = Get-AzureRmSubscription | Out-GridView -Title "Select a Subscription" -PassThru
Select-AzureRmSubscription -SubscriptionId $subscription.Id

# 3. The script will query the available VMs and promt to select the target VM from the VM list
 
$vm = Get-AzureRmVM | Out-GridView -Title "Select the Virtual Machine to add Data Disks to" -PassThru

# 4. I set the storage type based on the OS disk. If you want to spesify somehting else you can cahnge this to: $storageType = StandardLRS or PremiumLRS etc.

$storageType = $VM.StorageProfile.OsDisk.ManagedDisk.StorageAccountType

# 5. The script will promt for disk size, in GB

$diskSizeinGB = Read-Host "Enter Size for each Data Disk in GB"

$diskConfig = New-AzureRmDiskConfig -AccountType $storageType -Location $vm.Location -CreateOption Empty -DiskSizeGB $diskSizeinGB

# 6. Enter how many data disks you need to create
 
$diskquantity = Read-Host "How many disks you need to create?"

for($i = 1; $i -le $diskquantity; $i++)
{
$diskName = $vm.Name + "-DataDisk-" + $i.ToString()
$DataDisk = New-AzureRmDisk -DiskName $diskName -Disk $diskConfig -ResourceGroupName $vm.ResourceGroupName
$lun = $i - 1
Add-AzureRmVMDataDisk -VM $vm -Name $DiskName -CreateOption Attach -ManagedDiskId $DataDisk.Id -Lun $lun
}

Update-AzureRmVM -VM $vm -ResourceGroupName $vm.ResourceGroupName</pre>
<p>You can download the script from here: <a href="https://www.e-apostolidis.gr/wp-content/uploads/2017/09/AddManagedDisks.zip">AddManagedDisks</a></p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author">
<div class="saboxplugin-tab">
<div class="saboxplugin-gravatar"><img loading="lazy" decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div>
<div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div>
<div class="saboxplugin-desc">
<div itemprop="description">
<p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div>
</div>
<div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div>
<div class="clearfix"></div>
<div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:pr&#111;&#120;&#105;m&#097;&#103;&#114;&#064;ho&#116;m&#097;&#105;&#108;.&#099;&#111;&#109;" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div>
</div>
</div>
<p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fadd-multiple-managed-disks-to-azure-rm-vm%2F&amp;linkname=Add%20multiple%20managed%20disks%20to%20Azure%20RM%20VM" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fadd-multiple-managed-disks-to-azure-rm-vm%2F&amp;linkname=Add%20multiple%20managed%20disks%20to%20Azure%20RM%20VM" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fadd-multiple-managed-disks-to-azure-rm-vm%2F&#038;title=Add%20multiple%20managed%20disks%20to%20Azure%20RM%20VM" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/add-multiple-managed-disks-to-azure-rm-vm/" data-a2a-title="Add multiple managed disks to Azure RM VM"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/add-multiple-managed-disks-to-azure-rm-vm/">Add multiple managed disks to Azure RM VM</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure/add-multiple-managed-disks-to-azure-rm-vm/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>Azure VM Image</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/azure-vm-image/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/azure-vm-image/#respond</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Tue, 04 Jul 2017 20:14:35 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azure vm]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[template]]></category>
		<guid isPermaLink="false">http://www.e-apostolidis.gr/?p=1351</guid>

					<description><![CDATA[<p>Azure VM Image Following one of my earlier posts, about Azure Managed Disks, lets see how easy it is to</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-vm-image/">Azure VM Image</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Azure VM Image</h1>
<p>Following one of my earlier posts, about <a href="http://www.e-apostolidis.gr/microsoft/azure-managed-disks-easy-scale-high-available-secure/">Azure Managed Disks</a>, lets see how easy it is to create an Azure VM Image from an Azure VM that uses Managed Disks.</p>
<p>The first step it to Sysprep/Generalize the source VM. Otherwise the VM that will be created will not start. Select Generalize and &#8220;Shutdown&#8221;.</p>
<p id="NGgbPeD"><img loading="lazy" decoding="async" width="493" height="342" class="alignnone size-full wp-image-1353 " src="http://www.e-apostolidis.gr/wp-content/uploads/2017/07/img_595bf1eca1f3d.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf1eca1f3d.png 493w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf1eca1f3d-300x208.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf1eca1f3d-200x140.png 200w" sizes="auto, (max-width: 493px) 100vw, 493px" /></p>
<p>After that wait the VM to shut down and go to the Azure Porta, at the VM&#8217;s blade and click &#8220;Capture&#8221;.</p>
<p id="zNVgTmu"><img loading="lazy" decoding="async" width="660" height="163" class="alignnone size-full wp-image-1354 " src="http://www.e-apostolidis.gr/wp-content/uploads/2017/07/img_595bf26118089.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf26118089.png 660w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf26118089-300x74.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf26118089-600x148.png 600w" sizes="auto, (max-width: 660px) 100vw, 660px" /></p>
<p>Now, the &#8220;Create Image&#8221; blade will open. Enter a name, select a Resource Group and choose if the source VM will be deleted or not. Then press create.</p>
<p id="gdDzIgl"><img loading="lazy" decoding="async" width="587" height="390" class="alignnone size-full wp-image-1355 " src="http://www.e-apostolidis.gr/wp-content/uploads/2017/07/img_595bf2b81f6a3.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf2b81f6a3.png 587w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf2b81f6a3-300x199.png 300w" sizes="auto, (max-width: 587px) 100vw, 587px" /></p>
<p>As soon as the Image is created you can find it at the &#8220;Images&#8221; service.</p>
<p id="dVIPYfu"><img loading="lazy" decoding="async" width="565" height="267" class="alignnone size-full wp-image-1357 " src="http://www.e-apostolidis.gr/wp-content/uploads/2017/07/img_595bf39e42068.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf39e42068.png 565w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf39e42068-300x142.png 300w" sizes="auto, (max-width: 565px) 100vw, 565px" /></p>
<p>Now lets create a VM from our Image</p>
<p>Click the image name from the Images Blade to open the desired image Blade and just press &#8220;Create VM&#8221;.</p>
<p>Of course at the image&#8217;s blade we can see if the image is Windows or Linux, if it has any Data Disks and the Location.</p>
<p id="eMjrDKP"><img loading="lazy" decoding="async" width="745" height="475" class="alignnone size-full wp-image-1359 " src="http://www.e-apostolidis.gr/wp-content/uploads/2017/07/img_595bf410aa138.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf410aa138.png 745w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf410aa138-300x191.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf410aa138-600x383.png 600w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf410aa138-660x421.png 660w" sizes="auto, (max-width: 745px) 100vw, 745px" /></p>
<p>After clicking the &#8220;Create VM&#8221; the classic &#8220;Create virtual machine&#8221; wizard will start, just like any other Virtual Machine creation. You will notice the difference at the final step that shows the name of your image instead of the VM&#8217;s OS.</p>
<p id="pTbcWIm"><img loading="lazy" decoding="async" width="613" height="529" class="alignnone size-full wp-image-1360 " src="http://www.e-apostolidis.gr/wp-content/uploads/2017/07/img_595bf48419e65.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf48419e65.png 613w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf48419e65-300x259.png 300w, https://www.cloudcorner.gr/wp-content/uploads/2017/07/img_595bf48419e65-600x518.png 600w" sizes="auto, (max-width: 613px) 100vw, 613px" /></p>
<p>If you want to automate the process of creating an Azure VM from your images you can use Azure Template. You can find a quick start template at Azure&#8217;s GitHub repository.</p>
<p>Create a Virtual Machine from a User Image: <a href="https://github.com/Azure/azure-quickstart-templates/tree/master/101-vm-from-user-image">https://github.com/Azure/azure-quickstart-templates/tree/master/101-vm-from-user-image</a></p>
<p>&nbsp;</p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author">
<div class="saboxplugin-tab">
<div class="saboxplugin-gravatar"><img loading="lazy" decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div>
<div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div>
<div class="saboxplugin-desc">
<div itemprop="description">
<p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div>
</div>
<div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div>
<div class="clearfix"></div>
<div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:pro&#120;imag&#114;&#064;&#104;&#111;tmail.c&#111;m" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div>
</div>
</div>
<p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fazure-vm-image%2F&amp;linkname=Azure%20VM%20Image" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fazure-vm-image%2F&amp;linkname=Azure%20VM%20Image" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fazure-vm-image%2F&#038;title=Azure%20VM%20Image" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/azure-vm-image/" data-a2a-title="Azure VM Image"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/azure-vm-image/">Azure VM Image</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure/azure-vm-image/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>High Level Steps to Create a Syslog Server for Azure OMS (Log Analytics)</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/high-level-steps-create-syslog-server-azure-oms-log-analytics/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/high-level-steps-create-syslog-server-azure-oms-log-analytics/#respond</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Tue, 20 Jun 2017 10:20:19 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azurerm]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[network monitor]]></category>
		<category><![CDATA[oms]]></category>
		<category><![CDATA[operations management suite]]></category>
		<category><![CDATA[syslog]]></category>
		<guid isPermaLink="false">http://www.e-apostolidis.gr/?p=1292</guid>

					<description><![CDATA[<p>High Level Steps to Create a Syslog Server for Azure OMS (Log Analytics) &#160; This post is a gathering of</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/high-level-steps-create-syslog-server-azure-oms-log-analytics/">High Level Steps to Create a Syslog Server for Azure OMS (Log Analytics)</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><span style="text-decoration: underline; font-size: 20px;"><strong>High Level Steps to Create a Syslog Server for Azure OMS (Log Analytics)</strong></span></p>
<p>&nbsp;</p>
<p>This post is a gathering of TechNet articles and 3rd party blog posts that my college John Dandelis followed to create a linux Syslog server in order to monitor network devices on Operations Management Suite (OMS). Its not a complete step-by-step guide but it is very useful as a reference.</p>
<p>&nbsp;</p>
<p>-Install Ubuntu server VM.</p>
<p>Use any Bash Shell to connect to Ubuntu Server. (http://win-bash.sourceforge.net/)</p>
<p>To install Bash shell in windows 10: From updates and security enable for developers, developer mode. From add remove windows components add windows subsystem for Linux.</p>
<p>&nbsp;</p>
<p>-Connect to Ubuntu server: ssh &lt;syslog username&gt;@&lt;syslogIP&gt;</p>
<p>&nbsp;</p>
<p>-Setup Ubuntu Syslog</p>
<p><a href="https://msandbu.wordpress.com/2016/02/22/monitoring-syslog-from-oms-with-non-oms-agents/">https://msandbu.wordpress.com/2016/02/22/monitoring-syslog-from-oms-with-non-oms-agents/</a></p>
<p>&nbsp;</p>
<p>Edit rsyslog.conf file:   (to edit press “insert”. To quit press “esc” and type “:q” to quit, “:wq” to save and quit, “:q!” to quit without saving )</p>
<p>sudo vim /etc/rsyslog.conf</p>
<p>&nbsp;</p>
<p>Uncomment Lines (remove # sign):</p>
<p>#$ModLoad imudp</p>
<p>#$UDPServerRun 514</p>
<p>&nbsp;</p>
<p>-Create a templatefor log receipt</p>
<p>Add Lines Before GLOBAL DIRECTIVES</p>
<p><em>$template RemoteLogs,&#8221;/var/log/%HOSTNAME%/%PROGRAMNAME%.log&#8221; *</em></p>
<p><em>*,*  ?RemoteLogs</em></p>
<p>&nbsp;</p>
<p>(The $template RemoteLogs directive (&#8220;RemoteLogs&#8221; string can be changed to any other descriptive name) forces rsyslog daemon to write log messages to separate local log files in /var/log/, where log file names are defined based on the hostname of the remote sending machine as well as the remote application that generated the logs. The second line (&#8220;*.* ?RemoteLogs&#8221;) implies that we apply RemoteLogs template to all received logs.)</p>
<p>&nbsp;</p>
<p>-Restart syslog service</p>
<p>sudo service rsyslog restart</p>
<p>&nbsp;</p>
<p>Install OMS Agent from OMS&#8211;&gt;Overview&#8211;&gt;Settings&#8211;&gt;Connected Sources&#8211;&gt;Linux Servers</p>
<p>Copy the &#8220;<strong>DOWNLOAD AND ONBOARD AGENT FOR LINUX</strong>&#8221; field and paste into Ubuntu Bash.</p>
<p>&nbsp;</p>
<p>Add Syslog Facilities from Overview&#8211;&gt;Settings&#8211;&gt;Data&#8211;&gt;Syslog</p>
<p>local0 or whatever is the device facility you collect logs from.</p>
<p>&nbsp;</p>
<p>Show Most Recent Logs</p>
<p>tail -f /var/log/syslog</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Χρήσιμα Site:</p>
<p>&nbsp;</p>
<p>Create syslog in Ubuntu Server</p>
<p><a href="http://blogbt.net/index.php/2013/11/syslog-server-on-ubuntu/">http://blogbt.net/index.php/2013/11/syslog-server-on-ubuntu/</a></p>
<table width="90%">
<tbody>
<tr>
<td>&nbsp;</p>
<p><a href="http://blogbt.net/index.php/2013/11/syslog-server-on-ubuntu/">Setting up SysLog Server on Ubuntu &#8211; BlogBT.net</a></p>
<p>blogbt.net</p>
<p>Setting up a syslog server on ubuntu for easy troubleshooting and log keeping</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>https://www.adamcouch.co.uk/syslog-server/</p>
<p>&nbsp;</p>
<p>VIM Editor:</p>
<p><a href="https://stackoverflow.com/questions/11828270/how-to-exit-the-vim-editor">https://stackoverflow.com/questions/11828270/how-to-exit-the-vim-editor</a></p>
<p>Hit the Esc key; vim goes into command mode. Then you can type</p>
<ul>
<li>:qto quit (short for :quit)</li>
<li>:q!to quit without saving (short for :quit!)</li>
<li>:wqto write and quit (think write and quit)</li>
<li>:wq!to write and quit even if file has only read permission (if file does not have write permission: force write)</li>
<li>:xto write and quit (similar to :wq, but won&#8217;t write if there are no changes)</li>
<li>:qato quit all (short for :quitall)</li>
</ul>
<p>&nbsp;</p>
<p>OMS Agent for Linux</p>
<p><a href="https://github.com/Microsoft/OMS-Agent-for-Linux/blob/master/installer/conf/omsagent.d/syslog.conf">https://github.com/Microsoft/OMS-Agent-for-Linux/blob/master/installer/conf/omsagent.d/syslog.conf</a></p>
<p>&nbsp;</p>
<p>https://blogs.technet.microsoft.com/msoms/2016/05/12/syslog-collection-in-operations-management-suite/</p>
<p>&nbsp;</p>
<p>Install Azure Power Shell</p>
<p>https://docs.microsoft.com/en-us/powershell/azure/install-azurerm-ps?view=azurermps-4.0.0</p>
<p>&nbsp;</p>
<p>Install Agent For log analytics</p>
<p>https://docs.microsoft.com/en-us/azure/log-analytics/log-analytics-linux-agents</p>
<p>&nbsp;</p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author">
<div class="saboxplugin-tab">
<div class="saboxplugin-gravatar"><img loading="lazy" decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div>
<div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div>
<div class="saboxplugin-desc">
<div itemprop="description">
<p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div>
</div>
<div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div>
<div class="clearfix"></div>
<div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:p&#114;o&#120;imag&#114;&#064;&#104;&#111;t&#109;ai&#108;&#046;com" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div>
</div>
</div>
<p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fhigh-level-steps-create-syslog-server-azure-oms-log-analytics%2F&amp;linkname=High%20Level%20Steps%20to%20Create%20a%20Syslog%20Server%20for%20Azure%20OMS%20%28Log%20Analytics%29" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fhigh-level-steps-create-syslog-server-azure-oms-log-analytics%2F&amp;linkname=High%20Level%20Steps%20to%20Create%20a%20Syslog%20Server%20for%20Azure%20OMS%20%28Log%20Analytics%29" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fhigh-level-steps-create-syslog-server-azure-oms-log-analytics%2F&#038;title=High%20Level%20Steps%20to%20Create%20a%20Syslog%20Server%20for%20Azure%20OMS%20%28Log%20Analytics%29" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/high-level-steps-create-syslog-server-azure-oms-log-analytics/" data-a2a-title="High Level Steps to Create a Syslog Server for Azure OMS (Log Analytics)"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/high-level-steps-create-syslog-server-azure-oms-log-analytics/">High Level Steps to Create a Syslog Server for Azure OMS (Log Analytics)</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure/high-level-steps-create-syslog-server-azure-oms-log-analytics/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Auto Start/Stop an Azure VM (ARM)</title>
		<link>https://www.cloudcorner.gr/microsoft/azure/auto-startstop-azure-vm-arm/</link>
					<comments>https://www.cloudcorner.gr/microsoft/azure/auto-startstop-azure-vm-arm/#respond</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Thu, 01 Dec 2016 14:07:54 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[automaticstartaction]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[azurerm]]></category>
		<guid isPermaLink="false">http://www.e-apostolidis.gr/?p=1046</guid>

					<description><![CDATA[<p>Auto start stop azure vm (ARM) For Azure VMs that are not needed to be running 24/7, we can use</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/auto-startstop-azure-vm-arm/">Auto Start/Stop an Azure VM (ARM)</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1><strong>Auto start stop azure vm (ARM)</strong></h1>
<p>For Azure VMs that are not needed to be running 24/7, we can use Azure Automation to schedule auto Start Stop Azure VM. First ensure to reserve resources if needed, such as the Private and the Public IP.</p>
<p>Now lets see how we will Auto Start/Stop an Azure VM (ARM). First create an Automation Account, go to the Azure Portal, expand more services and  search for automation. Then click the &#8220;Automation Accounts&#8221;</p>
<p id="wVHOPYQ"><img loading="lazy" decoding="async" width="625" height="178" class="alignnone size-full wp-image-1047 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/10/img_57f79674629bf.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2016/10/img_57f79674629bf.png 625w, https://www.cloudcorner.gr/wp-content/uploads/2016/10/img_57f79674629bf-300x85.png 300w" sizes="auto, (max-width: 625px) 100vw, 625px" /></p>
<p>At the Automation Accounts press &#8220;Add&#8221;</p>
<p id="TPbzYuV"><img loading="lazy" decoding="async" width="373" height="156" class="alignnone size-full wp-image-1049 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/10/img_57f7971d32e98.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2016/10/img_57f7971d32e98.png 373w, https://www.cloudcorner.gr/wp-content/uploads/2016/10/img_57f7971d32e98-300x125.png 300w" sizes="auto, (max-width: 373px) 100vw, 373px" /></p>
<p>At the Automation Account creation blade provide a Name, the Subscription, the Resource Group, trhe location and if it is the first Automation Account select Yes to create automatically a Run As account</p>
<p id="lyFArvW"><img loading="lazy" decoding="async" width="304" height="648" class="alignnone size-full wp-image-1050 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/10/img_57f79753e5566.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2016/10/img_57f79753e5566.png 304w, https://www.cloudcorner.gr/wp-content/uploads/2016/10/img_57f79753e5566-141x300.png 141w" sizes="auto, (max-width: 304px) 100vw, 304px" /></p>
<p>After the creation it will open the new Automation Account&#8217;s blade. Here click the &#8220;Runbooks&#8221;</p>
<p id="RbzvAXh"><img loading="lazy" decoding="async" width="581" height="480" class="alignnone size-full wp-image-1052 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/10/img_57f798ebe9830.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2016/10/img_57f798ebe9830.png 581w, https://www.cloudcorner.gr/wp-content/uploads/2016/10/img_57f798ebe9830-300x248.png 300w" sizes="auto, (max-width: 581px) 100vw, 581px" /></p>
<p>We don&#8217;t need to write any scripting since there are available Runbooks at the gallery, so select Browse gallery</p>
<p id="aGpdtdm"><img loading="lazy" decoding="async" width="353" height="103" class="alignnone size-full wp-image-1054 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/10/img_57f79b2079371.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2016/10/img_57f79b2079371.png 353w, https://www.cloudcorner.gr/wp-content/uploads/2016/10/img_57f79b2079371-300x88.png 300w" sizes="auto, (max-width: 353px) 100vw, 353px" /></p>
<p>At the Gallery search for the &#8220;Start Azure V2 VMs&#8221; and &#8220;Stop Azure V2 VMs&#8221; Graphical Runbooks.</p>
<p id="kXqsmbY"><img loading="lazy" decoding="async" width="578" height="127" class="alignnone size-full wp-image-1070 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/12/img_58401f20bd75c.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_58401f20bd75c.png 578w, https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_58401f20bd75c-300x66.png 300w" sizes="auto, (max-width: 578px) 100vw, 578px" /></p>
<p id="kdjhkRZ"><img loading="lazy" decoding="async" width="562" height="116" class="alignnone size-full wp-image-1069 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/12/img_58401f009cb86.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_58401f009cb86.png 562w, https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_58401f009cb86-300x62.png 300w" sizes="auto, (max-width: 562px) 100vw, 562px" /></p>
<p>Click the Runbook and a the new blade press Import. Type a unique name and press OK</p>
<p><img loading="lazy" decoding="async" width="198" height="76" class="alignnone size-full wp-image-1071 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/12/img_58401f7755119.png" alt="" /><img loading="lazy" decoding="async" width="199" height="123" class="alignnone size-full wp-image-1072 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/12/img_58402010139bf.png" alt="" /></p>
<p>After the import, we will be navigated to the Runbook and we need to Publish it in order to be able to use it. At the Runbook&#8217;s blade, press &#8220;Edit&#8221;</p>
<p id="qZlWMkR"><img loading="lazy" decoding="async" width="461" height="68" class="alignnone size-full wp-image-1073 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/12/img_584020407898d.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_584020407898d.png 461w, https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_584020407898d-300x44.png 300w" sizes="auto, (max-width: 461px) 100vw, 461px" /></p>
<p>And then press Publish</p>
<p id="vaKYdrF"><img loading="lazy" decoding="async" width="404" height="84" class="alignnone size-full wp-image-1075 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/12/img_584020edeec41.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_584020edeec41.png 404w, https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_584020edeec41-300x62.png 300w" sizes="auto, (max-width: 404px) 100vw, 404px" /></p>
<p>After the Publishing the Runbook is ready to Start and add Schedules. Now lets add Schedules to specify the VM and the schedule that will Start. Press &#8220;Schedule&#8221;</p>
<p><img loading="lazy" decoding="async" width="485" height="84" class="alignnone size-full wp-image-1076 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/12/img_584020f9543f7.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_584020f9543f7.png 485w, https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_584020f9543f7-300x52.png 300w" sizes="auto, (max-width: 485px) 100vw, 485px" /></p>
<p>Press Link a schedule to your runbook and then Create a new schedule</p>
<p id="QAYgJvm"><img loading="lazy" decoding="async" width="590" height="130" class="alignnone size-full wp-image-1078 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/12/img_5840220ecc774.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_5840220ecc774.png 590w, https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_5840220ecc774-300x66.png 300w" sizes="auto, (max-width: 590px) 100vw, 590px" /></p>
<p>Give a name to the schedule, and then select the Start date and time and the recurrency, at my example it will start the VM everyday at 7:00 am</p>
<p id="eHXSYPS"><img loading="lazy" decoding="async" width="293" height="654" class="alignnone size-full wp-image-1079 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/12/img_5840244cc1e4b.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_5840244cc1e4b.png 293w, https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_5840244cc1e4b-134x300.png 134w" sizes="auto, (max-width: 293px) 100vw, 293px" /></p>
<p>then go to the Parameters and provide the Resourcegroup name and the VM name and press OK.</p>
<p id="leymWsm"><img loading="lazy" decoding="async" width="314" height="657" class="alignnone size-full wp-image-1080 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/12/img_584024c921831.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_584024c921831.png 314w, https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_584024c921831-143x300.png 143w" sizes="auto, (max-width: 314px) 100vw, 314px" /></p>
<p>The Runbook is ready. Create more Schedules for all needed VMs. And then repeat the process for the &#8220;Stop Azure VM V2&#8221; runbook and you will have two Runbooks with many Schedules. To test a Runbook press &#8220;Start&#8221;.</p>
<p id="RpPdokz"><img loading="lazy" decoding="async" width="399" height="224" class="alignnone size-full wp-image-1082 " src="http://www.e-apostolidis.gr/wp-content/uploads/2016/12/img_584027f614947.png" alt="" srcset="https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_584027f614947.png 399w, https://www.cloudcorner.gr/wp-content/uploads/2016/12/img_584027f614947-300x168.png 300w" sizes="auto, (max-width: 399px) 100vw, 399px" /></p>
<p>&nbsp;</p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author">
<div class="saboxplugin-tab">
<div class="saboxplugin-gravatar"><img loading="lazy" decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div>
<div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div>
<div class="saboxplugin-desc">
<div itemprop="description">
<p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div>
</div>
<div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div>
<div class="clearfix"></div>
<div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:p&#114;o&#120;&#105;&#109;ag&#114;&#064;&#104;&#111;&#116;&#109;ai&#108;&#046;c&#111;&#109;" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div>
</div>
</div>
<p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fauto-startstop-azure-vm-arm%2F&amp;linkname=Auto%20Start%2FStop%20an%20Azure%20VM%20%28ARM%29" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fauto-startstop-azure-vm-arm%2F&amp;linkname=Auto%20Start%2FStop%20an%20Azure%20VM%20%28ARM%29" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fazure%2Fauto-startstop-azure-vm-arm%2F&#038;title=Auto%20Start%2FStop%20an%20Azure%20VM%20%28ARM%29" data-a2a-url="https://www.cloudcorner.gr/microsoft/azure/auto-startstop-azure-vm-arm/" data-a2a-title="Auto Start/Stop an Azure VM (ARM)"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/azure/auto-startstop-azure-vm-arm/">Auto Start/Stop an Azure VM (ARM)</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/azure/auto-startstop-azure-vm-arm/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Auto-Shutdown Hyper-V free with UPS</title>
		<link>https://www.cloudcorner.gr/microsoft/powershell/auto-shutdown-hyper-v-usb-ups/</link>
					<comments>https://www.cloudcorner.gr/microsoft/powershell/auto-shutdown-hyper-v-usb-ups/#respond</comments>
		
		<dc:creator><![CDATA[Pantelis Apostolidis]]></dc:creator>
		<pubDate>Wed, 19 Oct 2016 19:33:37 +0000</pubDate>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[core]]></category>
		<category><![CDATA[hyper-v]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[windows server]]></category>
		<guid isPermaLink="false">http://www.e-apostolidis.gr/?p=1059</guid>

					<description><![CDATA[<p>Auto-Shutdown Hyper-V free with USB UPS This post is about how to Auto Shutdown Hyper-v core with UPS using PowerShell and</p>
<p>The post <a href="https://www.cloudcorner.gr/microsoft/powershell/auto-shutdown-hyper-v-usb-ups/">Auto-Shutdown Hyper-V free with UPS</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Auto-Shutdown Hyper-V free with USB UPS</h1>
<p>This post is about how to Auto Shutdown Hyper-v core with UPS using PowerShell and also send email notifications based to UPS battery level.</p>
<p>Recently i installed a Windows Hyper-V 2012 R2 server (the free version) but my UPS doesn&#8217;t support Windows Core. No problem, we have PowerShell!! after some search on various sites &#8211; blogs &#8211; etc i end up creating the following script. It checks the battery status every 3 minutes, using WMI and when the battery drops below 50% is sends the shutdown signal. As long as you set the VMs to save on shutdown you are OK!</p>
<p>I also added a simple mail notification before the shutdown.</p>
<pre class="lang:ps decode:true">$batterystatus = (get-wmiobject -class CIM_Battery -namespace "root\CIMV2").EstimatedChargeRemaining
DO
{
 start-sleep -seconds 180
 $batterystatus = (get-wmiobject -class CIM_Battery -namespace "root\CIMV2").EstimatedChargeRemaining
 $batterystatus
 } While ($batterystatus -gt 50)
$login = "username"
$password = "password" | Convertto-SecureString -AsPlainText -Force
$credentials = New-Object System.Management.Automation.Pscredential -Argumentlist $login,$password
Send-MailMessage -Body "UPS Started - Server will shutdown in 5 minutes" -From mail@domain.com -To mymail@domain.com -Subject "Power Loss - UPS Started" -SmtpServer mail.domain.com -Credential $Credentials
shutdown /s /t 300</pre>
<p>Feel free to use my script and also edit at will based to your needs</p>
<div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author">
<div class="saboxplugin-tab">
<div class="saboxplugin-gravatar"><img loading="lazy" decoding="async" src="https://www.e-apostolidis.gr/wp-content/uploads/2019/05/mvpsummit2019.jpg" width="100"  height="100" alt="Pantelis Apostolidis" itemprop="image"></div>
<div class="saboxplugin-authorname"><a href="https://www.cloudcorner.gr/author/admin/" class="vcard author" rel="author"><span class="fn">Pantelis Apostolidis</span></a></div>
<div class="saboxplugin-desc">
<div itemprop="description">
<p>Pantelis Apostolidis is a Sr. Specialist, Azure at Microsoft and a former Microsoft Azure MVP. For the last 20 years, Pantelis has been involved to major cloud projects in Greece and abroad, helping companies to adopt and deploy cloud technologies, driving business value. He is entitled to a lot of Microsoft Expert Certifications, demonstrating his proven experience in delivering high quality solutions. He is an author, blogger and he is acting as a spokesperson for conferences, workshops and webinars. He is also an active member of several communities as a moderator in azureheads.gr and autoexec.gr. Follow him on Twitter @papostolidis.</p>
</div>
</div>
<div class="saboxplugin-web "><a href="https://www.cloudcorner.gr" target="_self" >www.cloudcorner.gr</a></div>
<div class="clearfix"></div>
<div class="saboxplugin-socials "><a title="Facebook" target="_blank" href="https://www.facebook.com/pantelis.apostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-facebook" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M76.7 512V283H0v-91h76.7v-71.7C76.7 42.4 124.3 0 193.8 0c33.3 0 61.9 2.5 70.2 3.6V85h-48.2c-37.8 0-45.1 18-45.1 44.3V192H256l-11.7 91h-73.6v229"></path></svg></span></a><a title="Linkedin" target="_blank" href="https://www.linkedin.com/in/papostolidis/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-linkedin" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M100.3 480H7.4V180.9h92.9V480zM53.8 140.1C24.1 140.1 0 115.5 0 85.8 0 56.1 24.1 32 53.8 32c29.7 0 53.8 24.1 53.8 53.8 0 29.7-24.1 54.3-53.8 54.3zM448 480h-92.7V334.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V480h-92.8V180.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V480z"></path></svg></span></a><a title="Instagram" target="_blank" href="https://www.instagram.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-instagram" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg></span></a><a title="Rss" target="_blank" href="https://wwwcloudcorner.gr/feed/rdf/" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-rss" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M128.081 415.959c0 35.369-28.672 64.041-64.041 64.041S0 451.328 0 415.959s28.672-64.041 64.041-64.041 64.04 28.673 64.04 64.041zm175.66 47.25c-8.354-154.6-132.185-278.587-286.95-286.95C7.656 175.765 0 183.105 0 192.253v48.069c0 8.415 6.49 15.472 14.887 16.018 111.832 7.284 201.473 96.702 208.772 208.772.547 8.397 7.604 14.887 16.018 14.887h48.069c9.149.001 16.489-7.655 15.995-16.79zm144.249.288C439.596 229.677 251.465 40.445 16.503 32.01 7.473 31.686 0 38.981 0 48.016v48.068c0 8.625 6.835 15.645 15.453 15.999 191.179 7.839 344.627 161.316 352.465 352.465.353 8.618 7.373 15.453 15.999 15.453h48.068c9.034-.001 16.329-7.474 16.005-16.504z"></path></svg></span></a><a title="Twitter" target="_blank" href="https://twitter.com/papostolidis" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 30"><path d="M26.37,26l-8.795-12.822l0.015,0.012L25.52,4h-2.65l-6.46,7.48L11.28,4H4.33l8.211,11.971L12.54,15.97L3.88,26h2.65 l7.182-8.322L19.42,26H26.37z M10.23,6l12.34,18h-2.1L8.12,6H10.23z" /></svg></span></a><a title="Github" target="_blank" href="https://github.com/proximagr" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-github" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path fill="currentColor" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg></span></a><a title="User email" target="_self" href="mailto:proximagr&#064;h&#111;tm&#097;i&#108;&#046;com" rel="nofollow noopener" class="saboxplugin-icon-grey"><svg aria-hidden="true" class="sab-user_email" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg></span></a></div>
</div>
</div>
<p><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fpowershell%2Fauto-shutdown-hyper-v-usb-ups%2F&amp;linkname=Auto-Shutdown%20Hyper-V%20free%20with%20UPS" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_print" href="https://www.addtoany.com/add_to/print?linkurl=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fpowershell%2Fauto-shutdown-hyper-v-usb-ups%2F&amp;linkname=Auto-Shutdown%20Hyper-V%20free%20with%20UPS" title="Print" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.cloudcorner.gr%2Fmicrosoft%2Fpowershell%2Fauto-shutdown-hyper-v-usb-ups%2F&#038;title=Auto-Shutdown%20Hyper-V%20free%20with%20UPS" data-a2a-url="https://www.cloudcorner.gr/microsoft/powershell/auto-shutdown-hyper-v-usb-ups/" data-a2a-title="Auto-Shutdown Hyper-V free with UPS"><img src="https://static.addtoany.com/buttons/share_save_171_16.png" alt="Share"></a></p><p>The post <a href="https://www.cloudcorner.gr/microsoft/powershell/auto-shutdown-hyper-v-usb-ups/">Auto-Shutdown Hyper-V free with UPS</a> appeared first on <a href="https://www.cloudcorner.gr">Apostolidis Cloud Corner</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.cloudcorner.gr/microsoft/powershell/auto-shutdown-hyper-v-usb-ups/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
