<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="https://blog.dangl.me/rss/xslt"?>
<rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0">
  <channel>
    <title>Dangl.Blog();</title>
    <link>https://blog.dangl.me/</link>
    <description>Blogging about .Net, DevOps, Networking and BIM. Home of the free GAEB Converter.</description>
    <generator>Articulate, blogging built on Umbraco</generator>
    <item>
      <guid isPermaLink="false">1259</guid>
      <link>https://blog.dangl.me/archive/safe-storage-of-strings-in-powershell-scripts/</link>
      <category>Windows Server</category>
      <title>Safe Storage of Strings in PowerShell Scripts</title>
      <description>&lt;p&gt;In &lt;a rel="noopener noreferrer" data-id="1254" href="/archive/connecting-to-windows-server-2016-essentials-vpn-without-directaccess/" target="_blank" title="Connecting to Windows Server 2016 Essentials VPN without DirectAccess"&gt;my last post&lt;/a&gt;, I made use of a script that sets a secret value. The script needs to run at each system start, so it needs to be stored on the server. However, I don't want to (and &lt;strong&gt;never&lt;/strong&gt; should!) store actual secrets in plain text files. Scripts tend to get stored in backups, source control or sent around via email.&lt;/p&gt;
&lt;blockquote&gt;Don't write something in an email you wouldn't also put on the front page of the New York Times.&lt;/blockquote&gt;
&lt;p&gt;You &lt;em&gt;don't&lt;/em&gt; want your passwords on the front page of the New York Times.&lt;/p&gt;
&lt;p&gt;There's a commandlet for working with &lt;span class="Code"&gt;SecureStrings&lt;/span&gt; in PowerShell. It's using local user account and machine information to encrypt and decrypt string values, so you manually create an "encrypted" string, store that in a script and it only ever works for a specific &lt;em&gt;user account / hardware combination&lt;/em&gt;. It's secure as long as someone doesn't have full access to the computer the script is running on. If someone has that kind of access, you're busted anyway...&lt;/p&gt;
&lt;p&gt;How do you do it?&lt;/p&gt;
&lt;p&gt;Easy! Invoke the following script with your secret as parameter, e.g. like this from the commandline:&lt;/p&gt;
&lt;p&gt;&lt;span class="Code"&gt;C:\Scripts&amp;gt;powershell .\ConvertPasswordToSecureString.ps1 P4$$w0rd&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;script src="https://gist.github.com/GeorgDangl/51f2cddb57f04e2a41a47bf3fd0392be.js?file=ConvertPasswordToSecureString.ps1"&gt;&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;It'll print a long string to the console. That's the one that's safe to store. You can put it in any script you want and retrieve it like this:&lt;/p&gt;
&lt;p&gt;
&lt;script src="https://gist.github.com/GeorgDangl/51f2cddb57f04e2a41a47bf3fd0392be.js?file=SetVpnPreSharedKey.ps1"&gt;&lt;/script&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span class="pl-k Code"&gt;$&lt;/span&gt;&lt;span class="pl-smi"&gt;&lt;span class="Code"&gt;sharedSecret&lt;/span&gt; is the decrypted string value. In the example, I'm using it to set my VPNs Pre Shared Secret at system startup.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Happy storing!&lt;/p&gt;</description>
      <pubDate>Thu, 27 Apr 2017 19:52:21 Z</pubDate>
      <a10:updated>2017-04-27T19:52:21Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1254</guid>
      <link>https://blog.dangl.me/archive/connecting-to-windows-server-2016-essentials-vpn-without-directaccess/</link>
      <category>Windows Server</category>
      <title>Connecting to Windows Server 2016 Essentials VPN without DirectAccess</title>
      <description>&lt;p&gt;Windows Server Essentials is a great option for your home network. I'm using it mostly for DNS, DHCP, client backups, storage and VPN but, really, you can do anything with it. The built-in Connector for Windows clients makes accessing your home network from anywhere charmingly easy, and Microsoft gives you a free &lt;span class="Code"&gt;*.remotewebaccess.com&lt;/span&gt; domain with dynamic DNS and automatic configuration on top of that. External clients connect via &lt;a rel="noopener noreferrer" href="https://en.wikipedia.org/wiki/DirectAccess" target="_blank" title="Wikipedia - Microsoft DirectAccess"&gt;Microsoft's DirectAccess&lt;/a&gt; back home. In case you haven't heard of it, it's basically Windows-only proprietary VPN.&lt;/p&gt;
&lt;p&gt;Before upgrading to Server 2016, I've used VPN extensively on my iPhone &amp;amp; iPad to access my home network. I chose to use L2PT with a PreSharedKey for connecting my iOS devices. Where &lt;a rel="noopener noreferrer" data-id="1219" href="/archive/setup-and-configure-vpn-and-nat-on-a-private-server/" target="_blank" title="Setup and Configure VPN and NAT on a Private Server"&gt;I could simply use the GUI in Server 2012 R2&lt;/a&gt;, Server 2016 is less cooperative:&lt;/p&gt;
&lt;p&gt;  &lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1118/02-legacymode.png" alt="Server 2016 Routing &amp;amp; RAS - Legacy Mode Disabled" data-id="1257"&gt;&lt;/p&gt;
&lt;p&gt;If you're not fluent in German, the &lt;em&gt;Routing &amp;amp; RAS&lt;/em&gt; app tells me that &lt;em&gt;I can't use the GUI for configuration since legacy mode is disabled&lt;/em&gt;. And I can't enable it. That's bad, but since &lt;em&gt;Microsoft ❤️ PowerShell&lt;/em&gt;, there are commandlets for everything! Just make sure to have the &lt;em&gt;Remote Access Tools for Windows Powershell&lt;/em&gt; feature installed (it comes automatically with the Essentials role).&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1119/01-add-role.png" alt="Windows Server 2016 - Remote Access PowerShell tools installation" data-id="1258"&gt;&lt;/p&gt;
&lt;p&gt;User &lt;a rel="noopener noreferrer" href="http://homeservershow.com/forums/index.php?/topic/11755-windows-server-2016-essentials/&amp;amp;page=5#elComment_125198" target="_blank" title="HomeServerShow - Windows Server 2016 VPN Configuration"&gt;mazo22 at HomeServerShow&lt;/a&gt; nicely explained the command to set a PreSharedKey:&lt;/p&gt;
&lt;p&gt;&lt;span class="Code"&gt;Set-VpnAuthProtocol -SharedSecret "YourSecretValueHere" -TunnelAuthProtocolsAdvertised PreSharedKey&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The PreSharedKey is not persisted during reboots, for security reasons. For convenience reasons, there is Windows Task Scheduler. Create a job, make it run at system start and call &lt;span class="Code"&gt;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe&lt;/span&gt; as programm and supply the path to your &lt;span class="Code"&gt;SetPreSharedKey.ps1&lt;/span&gt; as argument.&lt;/p&gt;
&lt;p&gt;But, for real: &lt;a rel="noopener noreferrer" data-id="1259" href="/archive/safe-storage-of-strings-in-powershell-scripts/" target="_blank" title="Safe Storage of Strings in PowerShell Scripts"&gt;Here's a complete sample&lt;/a&gt; script that shows you how to keep the secret safe, even in a script. &lt;strong&gt;Don't store the PreSharedKey as plain text in the script!&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;Connecting your iPhone or iPad to your home server&lt;/h2&gt;
&lt;p&gt;Simply set up a new VPN connection in your device, use the &lt;em&gt;L2TP&lt;/em&gt; type and your regular Active Directory username / password (without the domain specifier). The SharedSecret is what you've just set up.&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1120/03-ios-settings.png" alt="" data-udi="umb://media/005973cda83840aeb4d73fa21d572dfe"&gt;&lt;/p&gt;
&lt;p&gt;Happy connecting!&lt;/p&gt;</description>
      <pubDate>Thu, 27 Apr 2017 14:29:55 Z</pubDate>
      <a10:updated>2017-04-27T14:29:55Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1219</guid>
      <link>https://blog.dangl.me/archive/setup-and-configure-vpn-and-nat-on-a-private-server/</link>
      <category>Windows Server</category>
      <title>Setup and Configure VPN and NAT on a Private Server</title>
      <description>&lt;p&gt;Lately, I've been on a business trip for a few days. While the trip itself was fine, I was annoyed about not being able to access my Amazon Prime Video content from the hotel due to geo-IP issues, namely me being in the wrong country for my account. Since I happen to have a low-cost virtual server that I'm using for a lot of stuff already, I've decided to set up a VPN on it as well. You'll find a lot of information on setting that up on "real" servers, with dedicated network cards for both internal and external connections, but the process in this post will work just fine in a single NIC setup.&lt;/p&gt;
&lt;p&gt;In Windows Server 2012 R2 or 2016 it's a quite simple process, configuring your own VPN with NAT (Network Address Translation or just "Routing") is possible with built-in components.&lt;/p&gt;
&lt;h2&gt;Install the Routing and VPN Roles&lt;/h2&gt;
&lt;p&gt; In the Server Manager, go to &lt;span class="Code"&gt;Add Role &amp;amp; Features&lt;/span&gt; and select &lt;span class="Code"&gt;Remote Access&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1097/01_install-role.png" alt="Windows Server 2012 - Install Remote Access Role" data-id="1222"&gt;&lt;/p&gt;
&lt;p&gt;On the &lt;span class="Code"&gt;Role Services&lt;/span&gt; tab. make sure to check both &lt;span class="Code"&gt;DirectAccess &amp;amp; VPN (RAS)&lt;/span&gt; as well as &lt;span class="Code"&gt;Routing&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1098/02-role-services.png" alt="Windows Server - Add DirectAccess and Routing Services" data-id="1223"&gt;&lt;/p&gt;
&lt;p&gt;After the installation is complete, you can open your &lt;span class="Code"&gt;Routing &amp;amp; RAS&lt;/span&gt; (RRAS) management console via your installed programs.&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1099/03-routing-ras.png" alt="Windows Server - Routing &amp;amp; RAS (RRAS) Management Console Icon" data-id="1224"&gt;&lt;/p&gt;
&lt;p&gt;Right-click on your server node, select &lt;span class="Code"&gt;Configure Routing and RAS&lt;/span&gt; and select &lt;span class="Code"&gt;Custom Configuration&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1100/04-ras-configure-option.png" alt="Windows Server - Configure Routing and RAS Setup Wizard" data-id="1225"&gt;&lt;/p&gt;
&lt;p&gt;On the next screen, select both &lt;span class="Code"&gt;VPN&lt;/span&gt; (for connecting to the server) and &lt;span class="Code"&gt;NAT&lt;/span&gt; (so your VPN traffic gets routed to the internet). Click on next, approve your selection and wait until the service has started.&lt;/p&gt;
&lt;h2&gt;Configure VPN Access&lt;/h2&gt;
&lt;p&gt;There isn't a lot left to do for you, since the defaults are mostly correct for our use case here, but you'll want to configure some additional security settings and the assignment of local IPs to your connected devices.&lt;/p&gt;
&lt;p&gt;Right-click again on your server node and select &lt;span class="Code"&gt;Properties&lt;/span&gt;, then go to the &lt;span class="Code"&gt;Security&lt;/span&gt; tab, activate &lt;span class="Code"&gt;Allow user defined IPsec policy for L2TP/IKEv2 connections&lt;/span&gt; and enter a random, hard to guess key (just like your WiFi key or any password, really). You'll need that Pre Shared Key (PSK) when you manually configure clients, such as Windows machines or iOS devices.&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1102/06-enable-l2tp-psk.png" alt="Windows Server VPN - Configure IPsec Pre Shared Key" data-id="1227"&gt;&lt;/p&gt;
&lt;p&gt;Now, switch to the &lt;span class="Code"&gt;IPv4&lt;/span&gt; tab and tell it to use a static address pool for client connections. Ideally, you'd specify a range for private networks, like &lt;span class="Code"&gt;192.168.*.*&lt;/span&gt; or &lt;span class="Code"&gt;10.*.*.*&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1103/07-static-address-pool.png" alt="Windows Server VPN - Static IP Address Pool Configuration" data-id="1228"&gt;&lt;/p&gt;
&lt;p&gt;After clicking OK, you'll have to select the server node again and navigate to &lt;span class="Code"&gt;All Tasks -&amp;gt; Restart&lt;/span&gt; in it's context menu to restart the service.&lt;/p&gt;
&lt;p&gt;The next step is to either create a new user or modify an existing one. All you have to do is to open the users properties (which is in &lt;span class="Code"&gt;Computer Management -&amp;gt; Local Users and Groups&lt;/span&gt; if you're not in an Active Directory domain), switch to the &lt;span class="Code"&gt;Dial In&lt;/span&gt; tab and make sure to allow dial in network access.&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1104/08-allow-user-dial-in-access.png" alt="Windows Server - Configure User to Allow Dial In Access" data-id="1229"&gt;&lt;/p&gt;
&lt;h2&gt;Configure NAT&lt;/h2&gt;
&lt;p&gt;NAT stands for Network Address Translation and is interesting because it’s basically using a single public IP address to serve multiple clients on the inside. It's essentially what a regular router does for you at home. In a VPN setup, you not only want to connect to the internal network (Which is quite boring, being on a single virtual server somewhere on the web, actually…) but to use the server as your gateway to the internet. This has two big advantages:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Your public IP will be your servers IP. You’ll finally be able to access your Amazon Prime Video from wherever you are!&lt;/li&gt;
&lt;li&gt;Traffic between you and the VPN server is encrypted. This is huge, since it means that even non-secure web traffic is encrypted till it leaves your server, so no one is able to snoop your data while using a public WiFi.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To set it up, expand the &lt;span class="Code"&gt;IPv4&lt;/span&gt; node below your server, right-click on &lt;span class="Code"&gt;NAT&lt;/span&gt; and select &lt;span class="Code"&gt;New Device&lt;/span&gt;. Just select your public network interface and enable NAT on it:&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1105/09-enable-nat.png" alt="Windows Server - Enable NAT on Network Interface" data-id="1230"&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Congratulations, you've just set up your private VPN!&lt;/span&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;span&gt;&lt;strong&gt;Tip:&lt;/strong&gt; If you’re experiencing troubles, check that your public network card does have some DNS servers configured. For me, my hosting company is using DHCP to assign my servers IP address and DNS servers, but I noticed that they’re not being passed on to connected clients. Just manually add some DNS servers (8.8.8.8 and 8.8.4.4, Googles public DNS servers, are good candidates) and you should be good to go.&lt;/span&gt;&lt;/blockquote&gt;</description>
      <pubDate>Mon, 17 Oct 2016 21:16:11 Z</pubDate>
      <a10:updated>2016-10-17T21:16:11Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1192</guid>
      <link>https://blog.dangl.me/archive/install-and-configure-web-deploy-for-an-iis-installation/</link>
      <category>Windows Server</category>
      <title>Install and Configure Web Deploy for an IIS Installation</title>
      <description>&lt;p&gt;Tutorials on Asp.Net deployment often do either focus on Azure deployment or for a more direct Xcopy or FTP deployment. Here, I’ll try to show you how to set up Microsoft Web Deploy for easy deployment to self-hosted IIS installations. Web Deploy can be installed via the Web Platform Installer, just search for &lt;span class="Code"&gt;Web Deploy&lt;/span&gt; and make sure to install the latest version (currently 3.6).&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1080/installwebdeploy.png" alt="Install Web Deploy from Web Platform Installer" data-id="1185"&gt;&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;em&gt;You only need the third entry in this screenshot&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Alternatively, download it directly from the &lt;a href="https://www.microsoft.com/de-DE/download/details.aspx?id=43717" target="_blank" title="Microsoft Download Center Web Deploy 3.6"&gt;Microsoft Download Center&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;For continuous integration scenarios, Web Deploy must be installed both on the build server (which will initiate the deployment process) as well as on the web server hosting IIS to enable inbound deployments.&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Grant Deployment Rights to a Windows User&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span&gt;On the hosting server, you need to have a user whom you’ll grant deployment rights on a per website basis. It’s not a good idea to use the account you’re logging in with, so just create some user with minimal permissions (only Read/Write access to the targeted websites directories is required).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then, in IIS, right click on your website, navigate to deployment and select &lt;span class="Code"&gt;Activate Web Deploy publishing&lt;/span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1085/enablewebdeployoniis-1.png" alt="Activating Web Deploy for a Website in IIS" data-id="1190"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In the following dialog, select the user whom you’ll want to grant deployment permission for that website and specify the Url for the deployment endpoint. The Url should just resolve to your server, since by default all hostnames will be accepted for the port 8172 that Web Deploy is using. Just make sure the Windows Firewall allows inbound connections on that port.&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1086/enablewebdeployoniis-2.png" alt="Web Deploy Activation Dialog" data-id="1191"&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;After clicking on setup, a &lt;span class="Code"&gt;*.PublishSettings&lt;/span&gt; file will be created on the directory that was specified, defaulting to the current logged in users' Desktop. For command line based deployment (or via Continuous Deployment), this file isn't needed, but when deploying from Visual Studio you should save that file somewhere for easy configuration of deployment setups. The selected user should have been automatically granted permissions for Web Deploy on the IIS server, but better check if there’s an entry for the user under &lt;span class="Code"&gt;IIS Manager Permissions&lt;/span&gt; in the server node within the Internet Information Services Manager application that specifies the selected site as Path.&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span&gt;Configuring SSL for the Web Deploy endpoint (IIS Management Service)&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span&gt;If you can, you absolutely should use TLS/SSL everywhere, especially for the endpoint you’re going to use for deploying websites. Even if you can’t get a trusted certificate (but then, &lt;a href="https://www.startssl.com" target="_blank" title="StartCom"&gt;StartCom&lt;/a&gt; issues them for free!), you should go with a self-signed one either directly from the server or from your domain root CA and trust that explicitly. It’s a really bad practice to ignore SSL errors, you should never let that catch on!&lt;br&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now on how to use it:&lt;br&gt;Go to the root node of your server in the IIS management application and select &lt;span class="Code"&gt;Management Service&lt;/span&gt; in the &lt;span class="Code"&gt;Management&lt;/span&gt; category. Here, click on &lt;span class="Code"&gt;stop&lt;/span&gt; on the right action menu to stop the service (you can’t change its settings when it’s running) and then simply select the SSL certificate you want to use. It’s got a self-signed default certificate, you can go with that, too, but then you’d have to export it out of the IIS certification store to be able to import it on your clients. When you’re done, just click on &lt;span class="Code"&gt;start&lt;/span&gt; in the action menu and you’re good to go.&lt;br&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1083/wmsvc_sslsettings.png" alt="Web Deploy Endpoint Connection Configuration" data-id="1188"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;strong&gt;Tip:&lt;/strong&gt; If you've got an SSL certificate for any website, you can use that, too. There’s no rule that says which DNS names you can use for your deployment service! It’s running on Port 8172 (or any other port that you can specify), so it doesn't interfere with any web sites.&lt;/blockquote&gt;
&lt;h2&gt;Error “User not authorized for content path” in Web Deploy&lt;/h2&gt;
&lt;p&gt;When performing the Web Deploy operation, you might get a response stating that the &lt;em&gt;user [is] not authorized for content path&lt;/em&gt;, even though the actual folder permissions are present and set correctly. To fix that, perform the following steps:&lt;br&gt;Go in IIS Manager to the server node and enter the configuration for &lt;span class="Code"&gt;Management Services Delegation&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1082/managementservicesdelegation.png" alt="IIS Management Services Delegation" data-id="1187"&gt;&lt;/p&gt;
&lt;p&gt;In the applet, select &lt;span class="Code"&gt;Add rule&lt;/span&gt; on the action menu on the right side, select &lt;span class="Code"&gt;Deploy Applications with content&lt;/span&gt; and click on OK.&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1081/managementservicecreateruledialog.png" alt="Create a new Rule in IIS Services Management Delegation" data-id="1186"&gt;&lt;/p&gt;
&lt;p&gt;Go with the standard settings here and create the rule. Now it should be visible in the &lt;span class="Code"&gt;Management Services Delegation&lt;/span&gt; menu. Right click the rule (it should be named &lt;span class="Code"&gt;contentPath, iisApp&lt;/span&gt; and select &lt;span class="Code"&gt;Add User&lt;/span&gt;. Then just specify the user you want to grant deployment rights. Be careful not to forget the domain identifier or the local computer name for a local account, e.g. &lt;span class="Code"&gt;LocalServer\DeploymentUser&lt;/span&gt;.&lt;br&gt;After that, go back to the server root node, enter &lt;span class="Code"&gt;Management Service&lt;/span&gt; and select &lt;span class="Code"&gt;Restart&lt;/span&gt; in the action menu. Now you should be good to go!&lt;br&gt;There might be other issues, like &lt;span class="Code"&gt;ERROR_USER_NOT_AUTHORIZED_FOR_SETACL&lt;/span&gt;. As far as I know, when you install Web Deploy, those rules should somehow be created automatically for non-administrator users, but they never were in any of my installs. To solve this, just modify the rule that was just created and append the missing privilege, e.g. append &lt;span class="Code"&gt;, setAcl&lt;/span&gt;  (don't forget the comma separator) to resolve permissions regarding the setAcl command.&lt;/p&gt;
&lt;h2&gt;Creating an IIS Apppool with a Windows Account&lt;/h2&gt;
&lt;p&gt;There are use scenarios where you want a dedicated user account to run a specific apppool or website. For example, having database access configured via the Windows Login in SQL Server or in Asp.Net Core where you can use user secrets to store machine specific configuration, such as connection strings or SMTP server credentials, specifically for a project in a Windows Users context. For this to work, the IIS Website needs to run in an Apppool that runs with the user account of a local or domain user. To set this up, simply create a local user account on the server that is hosting the IIS installation and assign it to the &lt;span class="Code"&gt;Remote Desktop Users&lt;/span&gt; group so that you can log in via remote desktop if you need to.&lt;br&gt;Then, create an Appool in IIS and go to its advanced settings. Here, scroll down to &lt;span class="Code"&gt;Identity&lt;/span&gt;, chose user defined account and enter the account name and credentials. Also make sure that &lt;span class="Code"&gt;Load User Profile&lt;/span&gt; is set to &lt;span class="Code"&gt;True&lt;/span&gt;. This tells IIS to actually load the user profile for the Windows User, which is needed if you’re planning on using Asp.Net Core user secrets for storing anything that should not be in source control.&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1084/aspnet5iisuser.png" alt="IIS Apppool User Account Configuration" data-id="1189"&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <pubDate>Wed, 22 Jun 2016 23:23:58 Z</pubDate>
      <a10:updated>2016-06-22T23:23:58Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1117</guid>
      <link>https://blog.dangl.me/archive/creating-self-signed-ssl-certificates-for-iis/</link>
      <category>Windows Server</category>
      <title>Creating Self Signed SSL Certificates for IIS</title>
      <description>&lt;p&gt;&lt;span&gt;Adding a TLS / SSL wildcard certificate to your IIS installation issued from your domain controller is pretty easy, assuming you’re having a Windows Server 2012 (R2) acting as domain controller. When the Essentials Role is installed, it automatically creates a Root Certificate Authority for your domain, so you don’t even have to set up anything special besides creating the requests for the certificates you want to use. Keep in mind that by default, only domain administrators are being automatically issued requested certificates. If the user you're logged in is not a domain administrator when you are making the certificate request, you have to manually issue it in the domain controllers certification management tool and then import it to IIS later.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now let’s start creating the certificate: In IIS Manager, navigate to the root entry for your server and select &lt;span class="Code"&gt;Server Certificates&lt;/span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;span&gt;&lt;img id="__mcenew" src="https://blog.dangl.me/media/1030/certificatesmenu_blurred.png" alt="IIS Manager Server Overview" data-id="1116"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Select &lt;span class="Code"&gt;Create Domain Certificate&lt;/span&gt; on the right actions menu and the certificate creation wizard opens:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1031/certrequest_01.png" alt="Active Directory IIS Certificate Request First Page" data-id="1118"&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The important information here is the &lt;span class="Code"&gt;shared name&lt;/span&gt; property, where you enter the URL for which the certificate will be valid. You can use wildcards like &lt;span class="Code"&gt;*.yourdomain.com&lt;/span&gt; to have the certificate be valid for all your sub domains. Click next to continue and you’re in the second and final page of certificate request wizard:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1032/certrequest_02.png" alt="Active Directory IIS Certificate Request Second Page" data-id="1119"&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When you’re using a vanilla Server 2012 Essentials environment, your root CA will be named like &lt;span class="Code"&gt;&amp;lt;DOMAIN&amp;gt;-&amp;lt;SERVER&amp;gt;-CA&lt;/span&gt;, so for a domain called &lt;span class="Code"&gt;Bob.local&lt;/span&gt; with the server name &lt;span class="Code"&gt;BobServer1&lt;/span&gt;, the name would be &lt;span class="Code"&gt;BOB-BOBSERVER1-CA&lt;/span&gt;. Append a backslash and the name of the server (a DNS entry that resolves to the server hosting the CA environment which is usually your server’s name). If your CA is on the home network, the webserver however is on another) server not in the same subnet (for example, a hosted virtual server), you can rely on the built-in VPN connection that is set up automatically when you’re using the Essentials Connector to establish a connection to your Certificate Authority.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Finally, the display name is the name that will be given to your certificate and shown in the IIS certification overview. If you've been successful, it should look like this:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1033/servercertificates_blurred.png" alt="IIS Installed Server Certificates" data-id="1120"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now when you create a binding for a website using Https, you’re able to select this certificate for the connection. You can now establish trusted connections between your devices and your personal sites=)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <pubDate>Sat, 30 Apr 2016 21:10:05 Z</pubDate>
      <a10:updated>2016-04-30T21:10:05Z</a10:updated>
    </item>
    <item>
      <guid isPermaLink="false">1093</guid>
      <link>https://blog.dangl.me/archive/install-a-windows-server-active-directory-root-certificate-in-ios/</link>
      <category>Windows Server</category>
      <title>Install a Windows Server Active Directory Root Certificate in iOs</title>
      <description>&lt;p&gt;Here's a short blog post showing you how to use self-signed certificates from your home network Active Directory Controller in iOS. I assume you either have a Windows Server 2012 (R2) with the Essentials role installed up and running on your domain or a "real" domain controller.&lt;/p&gt;
&lt;p&gt;On Server 2012 (R2) Essentials, there should be a website called "Default Web Site" installed within IIS which has a sub site called "CertSrv" for the certification service offered by the Active Directory domain controller (There's also the "Connect" site which you've probably used before to connect client machines). On Windows clients joined to the domain, your root domain Certificate Authority (CA) certificate should get installed by the default group policies that that the Essentials role is preconfigured with. For mobile devices (like iOS), you've got to add the root CA as trusted entity yourself. To do that, navigate to &lt;a&gt;http://&amp;lt;YourServerName&amp;gt;/Certsrv&lt;/a&gt;, log in with a domain user and you should find the following site:&lt;/p&gt;
&lt;p style="text-align: center;"&gt;&lt;img id="__mcenew" src="https://blog.dangl.me/media/1024/certserver_welcome.png" alt="Active Directory Certificate Server Welcome Site" data-id="1098"&gt;&lt;/p&gt;
&lt;p&gt;Click on the last link, which is, depending on your language, something like "Download a certificate authority root certificate". This should bring you to the next page where the standard settings will be fine for you.&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1025/certserver_requestroot.png" alt="Active Directory Certificate Server Select Certificate to Download" data-id="1097"&gt;&lt;/p&gt;
&lt;p&gt;Now just click on the uppermost link to install the certificate and find yourself in the iOS settings to review and confirm the installation. The certificate will be named "&amp;lt;YourADDomain&amp;gt;-&amp;lt;ServerName&amp;gt;-CA".&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1026/ios_installcertificate.png" alt="Install a certificate in iOS" data-id="1099"&gt;&lt;/p&gt;
&lt;p&gt;After you have installed it, you can browse to a website that is using this certificate and you'll see that's it accepted just like a regular certificate:&lt;/p&gt;
&lt;p&gt;&lt;img id="__mcenew" style="display: block; margin-left: auto; margin-right: auto;" src="https://blog.dangl.me/media/1027/verifyselfsignedcertificate.png" alt="Verification of working self signed certificates on the mobile Safari browser in iOS" data-id="1100"&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description>
      <pubDate>Fri, 22 Apr 2016 15:45:44 Z</pubDate>
      <a10:updated>2016-04-22T15:45:44Z</a10:updated>
    </item>
  </channel>
</rss>