diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeploymentParameterExtensions.cs b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeploymentParameterExtensions.cs
index 8534add2540aba534ff1766a2ed4c02e1526eba9..90f76fd8c29f516f87dd3aa2ed25d125b89e5455 100644
--- a/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeploymentParameterExtensions.cs
+++ b/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/IISDeploymentParameterExtensions.cs
@@ -43,14 +43,22 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS
 
         public static void SetWindowsAuth(this IISDeploymentParameters parameters, bool enabled = true)
         {
+            parameters.EnsureSection("windowsAuthentication", "system.webServer", "security", "windowsAuthentication");
             parameters.EnableModule("WindowsAuthenticationModule", "%IIS_BIN%\\authsspi.dll");
 
             parameters.AddServerConfigAction(
                 element =>
                 {
-                    element.Descendants("windowsAuthentication")
-                        .Single()
-                        .SetAttributeValue("enabled", enabled);
+                    var windowsAuthentication = element
+                        .RequiredElement("system.webServer")
+                        .RequiredElement("security")
+                        .RequiredElement("authentication")
+                        .GetOrAdd("windowsAuthentication");
+
+                    windowsAuthentication.SetAttributeValue("enabled", enabled);
+                    var providers = windowsAuthentication.GetOrAdd("providers");
+                    providers.GetOrAdd("add", "value", "Negotiate");
+                    providers.GetOrAdd("add", "value", "NTLM");
                 });
         }
 
@@ -59,8 +67,11 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS
             parameters.AddServerConfigAction(
                 element =>
                 {
-                    element.Descendants("anonymousAuthentication")
-                        .Single()
+                    element
+                        .RequiredElement("system.webServer")
+                        .RequiredElement("security")
+                        .RequiredElement("authentication")
+                        .GetOrAdd("anonymousAuthentication")
                         .SetAttributeValue("enabled", enabled);
                 });
         }
@@ -72,12 +83,33 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS
             parameters.AddServerConfigAction(
                 element =>
                 {
-                    element.Descendants("basicAuthentication")
-                        .Single()
+                    element
+                        .RequiredElement("system.webServer")
+                        .RequiredElement("security")
+                        .RequiredElement("authentication")
+                        .GetOrAdd("basicAuthentication")
                         .SetAttributeValue("enabled", enabled);
                 });
         }
 
+        public static void EnsureSection(this IISDeploymentParameters parameters, string name, params string[] path)
+        {
+            parameters.ServerConfigActionList.Add(
+                (config, _) => {
+
+                    var element = config
+                        .RequiredElement("configSections");
+
+                    foreach (var s in path)
+                    {
+                        element = element.GetOrAdd("sectionGroup", "name", s);
+                    }
+
+                    element.GetOrAdd("section", "name", "applicationInitialization")
+                       .SetAttributeValue("overrideModeDefault", "Allow");
+                });
+        }
+
         public static void EnableLogging(this IISDeploymentParameters deploymentParameters, string path)
         {
             deploymentParameters.WebConfigActionList.Add(
diff --git a/test/IISExpress.FunctionalTests/BasicAuthTests.cs b/test/Common.FunctionalTests/BasicAuthTests.cs
similarity index 92%
rename from test/IISExpress.FunctionalTests/BasicAuthTests.cs
rename to test/Common.FunctionalTests/BasicAuthTests.cs
index 1011b678ed7d548b47e0b4ab2d60793d407eff7c..1c7faf00b4d8a8cd89721d2d6a1e566ac60b5b1c 100644
--- a/test/IISExpress.FunctionalTests/BasicAuthTests.cs
+++ b/test/Common.FunctionalTests/BasicAuthTests.cs
@@ -32,7 +32,8 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
                 .WithAllAncmVersions()
                 .WithAllHostingModels();
 
-        [ConditionalTheory(Skip = "This test is manual. To run it set ASPNETCORE_MODULE_TEST_USER and ASPNETCORE_MODULE_TEST_PASSWORD environment variables to existing user")]
+        [ConditionalTheory]
+        [RequiresEnvironmentVariable("ASPNETCORE_MODULE_TEST_USER")]
         [RequiresIIS(IISCapability.BasicAuthentication)]
         [MemberData(nameof(TestVariants))]
         public async Task BasicAuthTest(TestVariant variant)
@@ -63,7 +64,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
             else
             {
                 // We expect out-of-proc not allowing basic auth
-                Assert.Equal("Windows:", responseText);
+                Assert.Equal("Windows", responseText);
             }
         }
     }
diff --git a/test/Common.FunctionalTests/Utilities/RequiresEnvironmentVariableAttribute.cs b/test/Common.FunctionalTests/Utilities/RequiresEnvironmentVariableAttribute.cs
new file mode 100644
index 0000000000000000000000000000000000000000..d2749db547d62c2589509a596cdb48088c5724f9
--- /dev/null
+++ b/test/Common.FunctionalTests/Utilities/RequiresEnvironmentVariableAttribute.cs
@@ -0,0 +1,24 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using Microsoft.AspNetCore.Server.IntegrationTesting;
+using Microsoft.AspNetCore.Testing.xunit;
+
+namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
+{
+    [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)]
+    public sealed class RequiresEnvironmentVariableAttribute : Attribute, ITestCondition
+    {
+        private readonly string _name;
+
+        public RequiresEnvironmentVariableAttribute(string name)
+        {
+            _name = name;
+        }
+
+        public bool IsMet => !string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable(_name));
+
+        public string SkipReason => $"Environment variable {_name} is required to run this test.";
+    }
+}
diff --git a/test/IISExpress.FunctionalTests/WindowsAuthTests.cs b/test/Common.FunctionalTests/WindowsAuthTests.cs
similarity index 100%
rename from test/IISExpress.FunctionalTests/WindowsAuthTests.cs
rename to test/Common.FunctionalTests/WindowsAuthTests.cs
diff --git a/test/IIS.FunctionalTests/ServicesTests.cs b/test/IIS.FunctionalTests/ServicesTests.cs
index 47e53b8d404b5a2770fb484554b52be9e0c3c080..875b5b13be8db4d091763b09849b8661749c1f8c 100644
--- a/test/IIS.FunctionalTests/ServicesTests.cs
+++ b/test/IIS.FunctionalTests/ServicesTests.cs
@@ -78,13 +78,9 @@ namespace IIS.FunctionalTests
 
         private static void EnablePreload(IISDeploymentParameters baseDeploymentParameters)
         {
+            baseDeploymentParameters.EnsureSection("applicationInitialization", "system.webServer");
             baseDeploymentParameters.ServerConfigActionList.Add(
                 (config, _) => {
-                    config
-                        .RequiredElement("configSections")
-                        .GetOrAdd("sectionGroup", "name", "system.webServer")
-                        .GetOrAdd("section", "name", "applicationInitialization")
-                        .SetAttributeValue("overrideModeDefault", "Allow");
 
                     config
                         .RequiredElement("system.applicationHost")
diff --git a/tools/SetupTestEnvironment.ps1 b/tools/SetupTestEnvironment.ps1
index 625b040e39f2daa0d7e0f5457b2f2b7f9a02abd1..3adaf7904517627235edd9bf71017d65aefa6885 100644
--- a/tools/SetupTestEnvironment.ps1
+++ b/tools/SetupTestEnvironment.ps1
@@ -57,8 +57,8 @@ function Setup-appverif($application)
 
 function Shutdown-appverif($application)
 {
-    setx APPVERIFIER_ENABLED_CODES "`"`"";
-    setx APPVERIFIER_LEVEL "`"`"";
+    setx APPVERIFIER_ENABLED_CODES "NONE";
+    setx APPVERIFIER_LEVEL "NONE";
 
     appverif.exe -disable * -for $application
 }