<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Deployment Service</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/deployment_service/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/deployment_service/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:41:28 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Setting up machines for Windows Remote Management (WinRM) deployment tasks</title>
      <link>https://docs.microsoft.com/archive/blogs/deployment_service/setting-up-machines-for-windows-remote-management-winrm-deployment-tasks</link>
      <pubDate>Mon, 28 Sep 2015 02:10:00 GMT</pubDate>
      <dc:creator><![CDATA[Ambrish Mishra [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/deployment_service/2015/09/28/setting-up-machines-for-windows-remote-management-winrm-deployment-tasks/</guid>
      <description><![CDATA[Applies to:
Release Management 2013 Update 3 and later: Run PS DSC action.
Release Management...]]></description>
      <content:encoded><![CDATA[<p><strong>Applies to:</strong></p>
<p><strong>Release Management 2013 Update 3 and later:</strong> Run PS DSC action.</p>
<p><strong>Release Management 2015:</strong> Run PS DSC action.</p>
<p><strong>Team Foundation Server 2015:</strong> Windows Remote Management based tasks in Build Hub wiz.&nbsp;PowerShell on Target Machines, Visual Studio Test Agent Deployment, Windows Machine File Copy.</p>
<p><strong>Visual Studio Online:</strong> Windows Remote Management based tasks in Build and Release Management Hub wiz.&nbsp;PowerShell on Remote Machines, Azure File Copy to Azure VMs, SQL Server Database Deployment, IIS Web Application Deployment, Visual Studio Test Agent Deployment</p>
<p>The tasks as described above use <a href="https://msdn.microsoft.com/en-us/library/aa384426(v=vs.85).aspx">Windows Remote Management</a> (WinRM) to access domain-joined/workgroup machines or Azure virtual machines. WinRM is Microsoft&rsquo;s implementation of&nbsp;<a href="https://msdn.microsoft.com/en-us/library/aa384470(v=vs.85).aspx">WS-Management Protocol</a> that is firewall-friendly and provides a common way for systems to access and exchange management information across on-premises or Cloud IT infrastructure. The automation agent that runs the deployment tasks uses WinRM to communicate with the target machines. It is important to setup WinRM properly on the target machines else the tasks will fail. The configuration of WinRM is described in detail on the MSDN <a href="https://msdn.microsoft.com/en-us/library/aa384372(v=vs.85).aspx">site</a>. For the target machines the following will ensure that the WinRM has been setup properly on them:</p>
<ol>
<li>Azure virtual machines only work with the WinRM HTTPS protocol. When creating <a href="https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-tutorial-classic-portal/">classic</a> or <a href="https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-tutorial/">resource manager</a> virtual machine from the Azure preview portal or Azure portal, the virtual machine is already setup for WinRM HTTPS, with the default port 5986 already open in Firewall, and a test certificate installed on the machine. These virtual machines can be directly added to a machine group, with the WinRM protocol selected as HTTPS, and the Skip CA Check (or Test Certificate) option selected. The Skip CA Check means that the certificate is a test certificate and the client should skip the validation of the certificate by a trusted certification authority.&nbsp;</li>
<li>To dynamically deploy Azure resource groups with virtual machines in them use the <a href="https://github.com/Microsoft/vso-agent-tasks/tree/master/Tasks/DeployAzureResourceGroup">Azure Resource Group Deployment</a> task. The task has a sample template that can setup the WinRM HTTPS protocol on the virtual machines, open the 5986 port in the Firewall, and install the test certificate.After this the virtual machines are ready for use in the deployment task.</li>
<li>For pre-existing on-premises machines, domain-joined or workgroup, and whether they are physical machines or virtual machines, set them up as per the table below to ensure that the deployment tasks work fine with them:</li>
</ol>
<p style="padding-left: 60px;"><strong>Target Machine State:</strong> Domain joined machine in a corporate network.</p>
<p style="padding-left: 60px;"><strong>Target Machine Trust with Automation Agent:</strong><strong> </strong>Trusted.</p>
<p style="padding-left: 60px;"><strong>Machine Identity: </strong>DNS name.</p>
<p style="padding-left: 60px;"><strong>Authentication Account:</strong> Domain account.</p>
<p style="padding-left: 60px;"><strong>Authentication Mode: </strong>Kerberos.<strong></strong></p>
<p style="padding-left: 60px;"><strong>Authentication Account Permission on Target Machine: </strong>Machine Administrator.<strong></strong></p>
<p style="padding-left: 60px;"><strong>Connection Type: </strong>WinRM HTTP<strong>.</strong></p>
<p style="padding-left: 60px;"><strong>Pre-requisites in target machine for WinRM deployment tasks to succeed: </strong>In the target machine, the WinRM HTTP port (default 5985) should be open in the Firewall and <a href="https://windows.microsoft.com/en-in/windows-vista/enable-file-and-printer-sharing">File &amp; Printer sharing</a> should be enabled.</p>
<p style="padding-left: 60px;">&nbsp;</p>
<p style="padding-left: 60px;"><strong>Target Machine State:</strong> Domain joined machine in a corporate network.</p>
<p style="padding-left: 60px;"><strong>Target Machine Trust with Automation Agent:</strong><strong> </strong>Trusted.</p>
<p style="padding-left: 60px;"><strong>Machine Identity: </strong>DNS name.</p>
<p style="padding-left: 60px;"><strong>Authentication Account:</strong> Domain account.</p>
<p style="padding-left: 60px;"><strong>Authentication Mode: </strong>Kerberos.<strong></strong></p>
<p style="padding-left: 60px;"><strong>Authentication Account Permission on Target Machine: </strong>Machine Administrator.<strong></strong></p>
<p style="padding-left: 60px;"><strong>Connection Type: </strong>WinRM HTTPS.<strong> </strong></p>
<p style="padding-left: 60px;"><strong>Pre-requisites in target machine for WinRM deployment tasks to succeed: </strong>In the target machine, the WinRM HTTPS port (default 5986) should be open in the Firewall and the <a href="https://windows.microsoft.com/en-in/windows-vista/enable-file-and-printer-sharing">File &amp; Printer sharing</a> should be enabled. The trusted certificate should be installed in the Automation agent, and&nbsp;if the trusted certificate is not installed in the Automation agent, then ensure that the skip CA check (or Test Certificate) option is selected&nbsp;in the tasks/machines hub&nbsp;for the application deployment to work.</p>
<p><strong>&nbsp;</strong></p>
<p style="padding-left: 60px;"><strong>Target Machine State:</strong> Domain joined machine, or workgroup machine in a corporate network.</p>
<p style="padding-left: 60px;"><strong>Target Machine Trust with Automation Agent:</strong><strong> </strong>Trusted or untrusted.</p>
<p style="padding-left: 60px;"><strong>Machine Identity: </strong>DNS name.</p>
<p style="padding-left: 60px;"><strong>Authentication Account:</strong> Local machine<br />account.</p>
<p style="padding-left: 60px;"><strong>Authentication Mode: </strong>NTLM.<strong></strong></p>
<p style="padding-left: 60px;"><strong>Authentication Account Permission on Target Machine: </strong>Machine Administrator.<strong></strong></p>
<p style="padding-left: 60px;"><strong>Connection Type: </strong>WinRM HTTP.<strong> </strong></p>
<p style="padding-left: 60px;"><strong>Pre-requisites in target machine for WinRM deployment tasks to succeed: </strong>In the target machine, the WinRM HTTP port (default 5985) should be opened in the Firewall, and&nbsp;<a href="https://support.microsoft.com/en-us/kb/951016">UAC remote restrictions</a>&nbsp;should be disabled, and the <a href="https://windows.microsoft.com/en-in/windows-vista/enable-file-and-printer-sharing">File &amp; Printer sharing</a> should be enabled. The target machine credentials should be&nbsp;provided in the format of&nbsp;domain\accountname or machine\accountname. Set the "AllowUnencrypted" option in the target machine, and add the remote machine in the "Trusted Host" list in the Automation Agent as shown in the command below:</p>
<p style="padding-left: 60px;">Automation Agent -</p>
<pre class="scroll"><code class="cplusplus"> winrm qc<br /> cd wsman:localhost\Client;Set-Item TrustedHosts -Value &ldquo;machine name&rdquo; -force<br /> </code></pre>
<pre class="scroll">		Target Machine - </pre>
<pre class="scroll"><code class="cplusplus"> Winrm qc <br /> cd wsman:localhost\Client;Set-Item AllowUnencrypted -Value $true -force<br /> </code>&nbsp;</pre>
<p style="padding-left: 60px;"><strong>Target Machine State:</strong> Domain joined machine, or workgroup machine in a corporate network.</p>
<p style="padding-left: 60px;"><strong>Target Machine Trust with Automation Agent:</strong><strong> </strong>Trusted or untrusted.</p>
<p style="padding-left: 60px;"><strong>Machine Identity: </strong>DNS name.</p>
<p style="padding-left: 60px;"><strong>Authentication Account:</strong> Local machine<br />account.</p>
<p style="padding-left: 60px;"><strong>Authentication Mode: </strong>NTLM.<strong></strong></p>
<p style="padding-left: 60px;"><strong>Authentication Account Permission on Target Machine: </strong>Machine Administrator.<strong></strong></p>
<p style="padding-left: 60px;"><strong>Connection Type: </strong>WinRM HTTPS.<strong> </strong></p>
<p style="padding-left: 60px;"><strong>Pre-requisites in target machine for WinRM deployment tasks to succeed: </strong>In the target machine, the WinRM HTTP port (default 5985) should be opened in the Firewall, and&nbsp;<a href="https://support.microsoft.com/en-us/kb/951016">UAC remote restrictions</a>&nbsp;should be disabled, and the <a href="https://windows.microsoft.com/en-in/windows-vista/enable-file-and-printer-sharing">File &amp; Printer sharing</a> should be enabled. The target machine credentials should be&nbsp;provided in the format of&nbsp;domain\accountname or machine\accountname. The trusted certificate should be installed in the Automation agent, and&nbsp;if the trusted certificate is not installed in the Automation agent, then ensure that the skip CA check (or Test Certificate) option is selected&nbsp;in the tasks/machines hub&nbsp;for the application deployment to work.</p>]]></content:encoded>
    </item>
    <item>
      <title>Windows Remote Management (WinRM) troubleshooting guide for remote sessions on the target machines</title>
      <link>https://docs.microsoft.com/archive/blogs/deployment_service/windows-remote-management-winrm-troubleshooting-guide-for-remote-sessions-on-the-target-machines</link>
      <pubDate>Fri, 11 Sep 2015 03:09:00 GMT</pubDate>
      <dc:creator><![CDATA[Ambrish Mishra [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/deployment_service/2015/09/11/windows-remote-management-winrm-troubleshooting-guide-for-remote-sessions-on-the-target-machines/</guid>
      <description><![CDATA[Applies to:
Release Management 2013 Update 3 and later:&nbsp;Run PS DSC action.
Release Management...]]></description>
      <content:encoded><![CDATA[<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><strong>Applies to:</strong></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Release Management 2013 Update 3 and later:&nbsp;Run PS DSC action.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Release Management 2015: Run PS DSC action.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Team Foundation Server 2015: PowerShell on Target Machines task in Build hub.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><strong>Most common causes:</strong></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">The reasons for&nbsp;PowerShell session on&nbsp;the target machine to fail are:</p>
<ol>
<li>
<div style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt; font-style: normal; font-weight: normal;">The remote machine does not&nbsp;have WinRM service running.</span></div>
</li>
<li>
<div style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">The remote Machine is not&nbsp;configured to listen on the port which you specified (HTTP/HTTPS).</span></div>
</li>
<li>
<div style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">The inbound firewall&nbsp;connection is not open for the WinRM port(HTTP/HTTPS) on the remote&nbsp;machine.</span></div>
</li>
<li>
<div style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">If it is an Azure IaaS&nbsp;machine, you would need to configure its endpoints to open the required&nbsp;PowerShell port(HTTP/HTTPS). Check this link for how to do that: </span><a href="https://azure.microsoft.com/en-in/documentation/articles/virtual-machines-set-up-endpoints/"><span style="font-family: Calibri; font-size: 11pt;">https://azure.microsoft.com/en-in/documentation/articles/virtual-machines-set-up-endpoints/</span></a>.</div>
</li>
</ol>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">By default in cases 1,&nbsp;2 and&nbsp;3 above if you are remoting over an HTTP port(5985 is the default) you can solve the problem by running this PowerShell command in the machine:</p>
<pre class="scroll"><code class="cplusplus">Winrm quickconfig</code>&nbsp;</pre>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">The above command will perform the following steps:</p>
<ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.375in; unicode-bidi: embed; direction: ltr;" type="disc">
<li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Start the WinRM service.</span></li>
<li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Set the WinRM service type to&nbsp;auto start.</span></li>
<li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Create an HTTP listener on&nbsp;port 5985 to accept requests on any IP address.</span></li>
<li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle;"><span style="font-family: Calibri; font-size: 11pt;">Enable firewall exception for&nbsp;WS-Management traffic (for http only).</span></li>
</ul>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">For HTTPS, if you have provisioned your machine on Azure portal, you would just need to open the PowerSHell HTTPS endpoint 5986 as it would be configured already. If you want to establish HTTPS remote PowerShell session on some standard/on-prem machine you would need to install a self-signed or a CA authority certificate in the remote machine's Local Machine Personal certificate store and configure the WinRM HTTPS listener against that certificate.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Another useful cmdlet for configuring WinRM service for Remote PowerShell on the remote machine would be:</p>
<pre class="scroll"><code class="csharp">Enable-PSRemoting</code></pre>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">You need to run this PowerShell command on the remote machine. You can read more about it here: <a href="https://technet.microsoft.com/en-us/library/hh849694.aspx">https://technet.microsoft.com/en-us/library/hh849694.aspx</a>. This cmdlet can solve some issues, if <span style="font-style: italic;">winrm quickconfig</span> does not seem to solve your problems.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;"><span style="font-weight: bold;">Note:</span> If you are using a workgroup machine or Azure machine or any machine outside the domain of the machine establishing remote connection where there is no trust or an IP address as the target machine name for remote PowerShell, it would use NTLM authentication instead of Kerberos Authentication. There if you are using HTTP you would need to add the remote host in the trusted hosts of the client machine establishing the remote PowerShell connection. Here is how to do it: <a href="https://winintro.ru/windowspowershell2corehelp.en/html/f23b65e2-c608-485d-95f5-a8c20e00f1fc.htm">https://winintro.ru/windowspowershell2corehelp.en/html/f23b65e2-c608-485d-95f5-a8c20e00f1fc.htm</a>. Or else you can remote over HTTPS to these type of machines where you would not need to add it to the Trusted Hosts of the client.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>