{"id":1871,"date":"2016-03-16T21:57:33","date_gmt":"2016-03-17T04:57:33","guid":{"rendered":"http:\/\/50.6.175.134\/~ricvilla\/?p=1871"},"modified":"2024-09-30T13:27:24","modified_gmt":"2024-09-30T13:27:24","slug":"enabling-winrm-remote-powershell-on-azure-resource-manager-windows-os-vms","status":"publish","type":"post","link":"http:\/\/www.ricardovillalobos.com\/?p=1871","title":{"rendered":"Enabling WinRM \/ Remote Powershell on Azure Resource Manager Windows OS VMs"},"content":{"rendered":"<p><em><a href=\"http:\/\/www.ricardovillalobos.com\/?attachment_id=1874\" rel=\"attachment wp-att-1874\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-1874\" src=\"http:\/\/www.ricardovillalobos.com\/wp-content\/uploads\/2016\/03\/powershell-logo-150x150.png\" alt=\"powershell-logo\" width=\"150\" height=\"150\" \/><\/a>Note: these instructions only apply to Windows VMs created using Azure Resource Manager. For VMs created in Azure Classic mode (old portal at http:\/\/manage.windowsazure.com), WinRM \/ Remote Powershell is enabled by default for certified Windows images.<\/em><\/p>\n<p>If you need WinRM (required to run remote Powershell commands) enabled on new Windows\u00a0Virtual Machines created using Azure Resource Manager, you have two options:<\/p>\n<p>1.\u00a0Deploy your instance using\u00a0the 201-vm-winrm-windows quick start ARM template located <a href=\"https:\/\/github.com\/Azure\/azure-quickstart-templates\/tree\/4b529b00eec1a48748e2f1ea0f305c0f07c87253\/201-vm-winrm-windows\">here<\/a>. It creates a self signed certificate and configures\u00a0all the firewall rules to accept HTTP and HTTPS connections in ports 5895 and 5896 (required by WinRM \/ Remote Powershell). You are done.<\/p>\n<p>2. For\u00a0VMs already deployed\u00a0on\u00a0Azure under the\u00a0Resource\u00a0Manager platform, and that\u00a0were created using base or custom Windows OS\u00a0images, do\u00a0the following:<\/p>\n<ul>\n<li>Remote Desktop into the virtual machine (which is enabled by default when\u00a0VMs are\u00a0created using the portal).<\/li>\n<li>From the quick start template located <a href=\"https:\/\/github.com\/Azure\/azure-quickstart-templates\/tree\/4b529b00eec1a48748e2f1ea0f305c0f07c87253\/201-vm-winrm-windows\">here<\/a>, copy the ConfigureWinRM.ps1,\u00a0winrmconf.cmd and makecert.exe files to a local directory in the VM.<\/li>\n<li>Using Powershell, go to the folder where you copied these three files and execute the ConfigureWinRM.ps1 script.<\/li>\n<li>For the hostname,\u00a0provide the exact FQDN that you used when the virtual machine was originally created.<\/li>\n<li>You are done!<\/li>\n<\/ul>\n<p>Now you can remotely\u00a0connect to your machine using Powershell and the <a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/hh849707.aspx\" target=\"_blank\" rel=\"noopener\">Enter-PSSession<\/a> cmdlet. Also, this is required if you are trying to certificate your image for the Azure Marketplace using the <a href=\"https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=44299\" target=\"_blank\" rel=\"noopener\">corresponding tool.<\/a><\/p>\n<p>Happy clouding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Note: these instructions only apply to Windows VMs created using Azure Resource Manager. For VMs created in Azure Classic mode (old portal at http:\/\/manage.windowsazure.com), WinRM \/ Remote Powershell is enabled by default for certified Windows images. If you need WinRM (required to run remote Powershell commands) enabled on new Windows\u00a0Virtual Machines created using Azure Resource&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[3,145],"tags":[164,16,165,163,166],"class_list":["post-1871","post","type-post","status-publish","format-standard","hentry","category-allposts","category-development","tag-arm","tag-azure","tag-powershell","tag-resourcemanager","tag-winrm"],"_links":{"self":[{"href":"http:\/\/www.ricardovillalobos.com\/index.php?rest_route=\/wp\/v2\/posts\/1871","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ricardovillalobos.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ricardovillalobos.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ricardovillalobos.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ricardovillalobos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1871"}],"version-history":[{"count":6,"href":"http:\/\/www.ricardovillalobos.com\/index.php?rest_route=\/wp\/v2\/posts\/1871\/revisions"}],"predecessor-version":[{"id":1968,"href":"http:\/\/www.ricardovillalobos.com\/index.php?rest_route=\/wp\/v2\/posts\/1871\/revisions\/1968"}],"wp:attachment":[{"href":"http:\/\/www.ricardovillalobos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1871"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ricardovillalobos.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1871"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ricardovillalobos.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}