{"id":11896,"date":"2025-04-23T16:29:57","date_gmt":"2025-04-23T07:29:57","guid":{"rendered":"https:\/\/chat-messenger.com\/?p=11896"},"modified":"2026-03-02T01:32:20","modified_gmt":"2026-03-01T16:32:20","slug":"windowsauthentication-setspn","status":"publish","type":"post","link":"https:\/\/chat-messenger.com\/en\/blog\/windowsauthentication-setspn","title":{"rendered":"IIS settings for successful IIS Integrated Windows Authentication in an L4 load balancer environment"},"content":{"rendered":"<h2>summary<\/h2>\n\n\n\n<p>The following article explains how to configure Integrated Windows Authentication (IWA) in IIS in an L4 load balancer + SSL termination environment.<\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -external\" data-type=\"type3\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">Chat&amp;Messenger for web conferencing<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img src=\"https:\/\/chat-messenger.com\/wp-content\/uploads\/2025\/03\/iStock-1313570693-2.jpg\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/chat-messenger.com\/en\/blog\/windowsauthentication-loadbalancer-ssl\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to configure IIS Integrated Windows Authentication successfully in a load balancer + SSL environment | Web conferencing Chat&amp;Messenger<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">About Integrated Windows Authentication Integrated Windows Authentication is a feature that automatically authenticates users when IIS and users belong to the same Active Directory domain.<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n\n<p>When configuring this method, there are many cases where authentication fails due to incorrect or duplicated SPN (Service Principal Name) settings.<\/p>\n\n\n\n<p>This article provides a comprehensive explanation of SPN registration and the required tasks.<\/p>\n\n\n\n<h2>Configuration example in this article<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>   &#91;Client Browser] \n          |\n          | HTTPS Access\n          v\n  &#91;L4 Load Balancer (TCP 443)]\n       |                |\n       v                v\n  &#91;Server1 (IIS)]   &#91;Server2 (IIS)]<\/code><\/pre>\n\n\n\n<ul><li>FQDN: <code>sso.chat-messenger.com<\/code><\/li><li>IIS Hostname: <code>Server1<\/code>, <code>Server2<\/code><\/li><li>Shared Services Accounts:<code>CAMTEST\\cam-svc<\/code><\/li><\/ul>\n\n\n\n<h2>Problem: Duplicate SPN error<\/h2>\n\n\n\n<p>With Integrated Windows Authentication, the client looks up the SPN for the FQDN it is accessing and obtains a Kerberos ticket for the appropriate service account.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>setspn -S HTTP\/sso.chat-messenger.com Server1$ setspn -S HTTP\/sso.chat-messenger.com Server2$<\/code><\/pre>\n\n\n\n<p>As shown above, the same FQDN (<code>sso.chat-messenger.com<\/code>When you register the SPN for the .NET Framework 2.0.1 on different hosts (Server1, Server2), the following error occurs:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Duplicate SPN found, aborting operation.<\/code><\/pre>\n\n\n\n<h2>Solution: Register the SPN in the shared service account<\/h2>\n\n\n\n<p>If multiple hosts use the same FQDN, only one SPN needs to be registered in the shared service account.<\/p>\n\n\n\n<h3>Creating a Shared Services Account<\/h3>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<p>A service account running in an IIS application pool can be a domain user (as long as it belongs to Domain Users), but to separate normal users and service accounts and to clarify the scope of password policy and prevent operational errors,<code>OU=ServiceAccounts<\/code> Like, OU <code>Users<\/code> In distinction from Active Directory domain controllers,<code>cam-svc<\/code> Create a new one.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<figure class=\"wp-block-image size-full is-resized is-style-border\"><img src=\"https:\/\/chat-messenger.com\/wp-content\/uploads\/2025\/04\/image-6.png\" alt=\"\" class=\"wp-image-11897\" width=\"355\" height=\"177\"\/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h3>Register SPN with service account<\/h3>\n\n\n\n<p>Register the SPN using the service account created above.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>setspn -S HTTP\/sso.chat-messenger.com CAMTEST\\cam-svc<\/code><\/pre>\n\n\n\n<p class=\"is-style-crease\">- Any terminal that is part of the domain can be used. However, domain administrator privileges are required.<br>\u30fbThe SPN is also used in HTTPS communication.<code>HTTP\/hostname<\/code>You must register in the format:<\/p>\n\n\n\n<h3>IIS Application Pool Settings<\/h3>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<p><code>Server1<\/code>, <code>Server2<\/code> Change the application pool execution user on both servers to the service account you created. <code>CAMTEST\\cam-svc<\/code> Set to<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<figure class=\"wp-block-image size-full is-resized is-style-border\"><img src=\"https:\/\/chat-messenger.com\/wp-content\/uploads\/2025\/04\/image-8.png\" alt=\"\" class=\"wp-image-11900\" width=\"294\" height=\"129\"\/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h3>IIS Manager &quot;Configuration Editor&quot;<\/h3>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<p>To change the IIS Application Pool to a Service Account and have Windows Authentication work correctly with Kerberos, you must configure the following in the &quot;Configuration Editor&quot; feature of IIS Manager:<\/p>\n\n\n\n<ul><li><code>system.webServer\/security\/authentication\/windowsAuthentication<\/code> section<\/li><li><code>useAppPoolCredentials<\/code> indicates object of desire, like, hate, etc. <code>True<\/code> Set to<\/li><li><code>useKernelMode<\/code> indicates object of desire, like, hate, etc. <code>False<\/code> Set to<\/li><\/ul>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<figure class=\"wp-block-image size-full is-resized\"><img src=\"https:\/\/chat-messenger.com\/wp-content\/uploads\/2026\/03\/image-3.png\" alt=\"\" class=\"wp-image-12573\" width=\"312\" height=\"146\"\/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p class=\"is-style-icon_pen\">If IIS is running on a domain controller, this setting may not be necessary.<\/p>\n\n\n\n<h3>Setting &quot;Log on as a batch job&quot; permission for the Shared Services account<\/h3>\n\n\n\n<p>The application pool responds to web requests. <code>w3wp.exe<\/code>(Worker process). If you run this under a shared service account, the process will be denied and an HTTP 503 error will occur if the account does not have the &quot;Log on as a batch job&quot; permission, so the shared service account must have the &quot;Log on as a batch job&quot; permission set (GPO-based).<\/p>\n\n\n\n<p>The following settings can be controlled by the local security policy of each IIS terminal, but there may be restrictions imposed by organizational policies in GPO (Group Policy Object) on the Active Directory domain controller. In that case, control is required in the GPO itself, and this article explains how to do so.<\/p>\n\n\n\n<p class=\"is-style-icon_pen\">If IIS is running on a domain controller, &quot;Log on as a batch job&quot; may not be necessary.<\/p>\n\n\n\n<h4>Steps to link the GPO to OU=ServiceAccounts<\/h4>\n\n\n\n<p>Service Account<code>CAMTEST\\cam-svc<\/code>indicates object of desire, like, hate, etc.<code>OU=ServiceAccounts<\/code>If you create it in<br>If you do not link a group policy (e.g. IIS-BatchLogon-GPO) to this OU,<code>cam-svc<\/code>The policy is not applied to. The target of the GPO is determined by &quot;which OU it is linked to&quot;, so it is important to match the location of the account with the linked GPO.<\/p>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<ol id=\"block-9e521cd8-e8b2-4326-89c3-89a3316f63e0\"><li><code>gpmc.msc<\/code> Run the command to start the Group Policy Management Editor.<\/li><li>In the left pane<code>camtest.com\/ServiceAccounts<\/code> Right-click on the OU \u2192 &quot;<strong>Create a GPO in this domain and link it to this container<\/strong>&quot; \u2192 Enter any name (e.g.<code>IIS-BatchLogon-GPO<\/code>)<\/li><li>Created<code>IIS-BatchLogon-GPO<\/code>Edit with<\/li><li>Computer Configuration \u2192 Windows Settings \u2192 Security Settings \u2192 Local Policies \u2192 User Rights Assignment \u2192 <strong>Log on as a batch job<\/strong><\/li><li>Double-click to open the dialog<code>CAMTEST\\cam-svc<\/code> Add a User<\/li><\/ol>\n<\/div>\n\n\n\n<div class=\"wp-block-column\">\n<figure class=\"wp-block-image size-full is-resized is-style-border\"><img src=\"https:\/\/chat-messenger.com\/wp-content\/uploads\/2025\/04\/image-9.png\" alt=\"\" class=\"wp-image-11902\" width=\"115\" height=\"114\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-border\"><img src=\"https:\/\/chat-messenger.com\/wp-content\/uploads\/2025\/04\/image-10.png\" alt=\"\" class=\"wp-image-11903\" width=\"151\" height=\"77\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-border\"><img src=\"https:\/\/chat-messenger.com\/wp-content\/uploads\/2025\/04\/image-11.png\" alt=\"\" class=\"wp-image-11904\" width=\"89\" height=\"109\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-border\"><img src=\"https:\/\/chat-messenger.com\/wp-content\/uploads\/2025\/04\/image-12.png\" alt=\"\" class=\"wp-image-11905\" width=\"169\" height=\"69\"\/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-border\"><img src=\"https:\/\/chat-messenger.com\/wp-content\/uploads\/2025\/04\/image-13.png\" alt=\"\" class=\"wp-image-11906\" width=\"81\" height=\"110\"\/><\/figure>\n<\/div>\n<\/div>\n\n\n\n<h4>About GPO settings<\/h4>\n\n\n\n<p>To apply the GPO correctly, you must<strong> <\/strong><code>gpupdate \/force<\/code><strong> <\/strong>It is important to run this command. This will ensure that the GPO settings take effect immediately. In particular, when granting the &quot;Log on as a batch job&quot; right, the policy may take effect at a later time. <code>w3wp.exe<\/code> This can lead to startup failures.<\/p>","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 \u4ee5\u4e0b\u306e\u8a18\u4e8b\u3067L4\u30ed\u30fc\u30c9\u30d0\u30e9\u30f3\u30b5\u30fc + SSL\u7d42\u7aef\u74b0\u5883\u3067\u3001IIS\u306b\u304a\u3051\u308b\u7d71\u5408Windows\u8a8d\u8a3c\uff08Integ [&hellip;]<\/p>","protected":false},"author":1,"featured_media":11704,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":""},"categories":[9,33],"tags":[],"_links":{"self":[{"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/posts\/11896"}],"collection":[{"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/comments?post=11896"}],"version-history":[{"count":10,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/posts\/11896\/revisions"}],"predecessor-version":[{"id":12574,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/posts\/11896\/revisions\/12574"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/media\/11704"}],"wp:attachment":[{"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/media?parent=11896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/categories?post=11896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chat-messenger.com\/en\/wp-json\/wp\/v2\/tags?post=11896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}