Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7613065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:04:37+00:00 2026-05-31T02:04:37+00:00

I have two IIS websites, namely accounts.example.com that was created in Visual Studio 2010

  • 0

I have two IIS websites, namely “accounts.example.com” that was created in Visual Studio 2010 using the ASP.NET MVC 3 Web Application and “api.example.com” created with Visual Studio 2010 using the “WCF REST Service Application”.

I created a powershell script to configure the environment. The function to create a website looks as follows:

function create-website([string]$name, [string]$relativePath) {

    $physicalPath = Join-Path -Path $scriptPath -ChildPath $relativePath
    $physicalPath = [IO.Path]::GetFullPath( $physicalPath )

    # Create an application pool and ensure it is using .NET 4
    New-WebAppPool -Name $name
    Set-ItemProperty IIS:\AppPools\$name managedRuntimeVersion v4.0

    # Create Website
    New-WebSite -Name $name -Port 80 -HostHeader $name -PhysicalPath $physicalPath
    # Set the Application Pool
    Set-ItemProperty IIS:\Sites\$name ApplicationPool $name
    Set-ItemProperty IIS:\Sites\$name ApplicationPool $name

    # Update Authentication
    Set-WebConfigurationProperty -filter /system.WebServer/security/authentication/AnonymousAuthentication -name enabled -value true -location $name
    Set-WebConfigurationProperty -filter /system.WebServer/security/authentication/windowsAuthentication -name enabled -value false -location $name
    Set-WebConfigurationProperty -filter /system.WebServer/security/authentication/basicAuthentication -name enabled -value false -location $name
}

And its called as follows:

create-website $accounts "..\src\accounts"
create-website $api "..\src\api\"

When I run the script, the accounts website is correctly configured (including authentication). However, when trying to configure the api site, I get the following error:

Set-WebConfigurationProperty : Filename: \\?\S:\example\src\api\web.config
Line number: 20
Error: The configuration section 'standardEndpoints' cannot be read because it is missing a section declaration
At S:\example\scripts\Install-DevelopmentEnvironment.ps1:26 char:33
+     Set-WebConfigurationProperty <<<<  -filter /system.WebServer/security/authentication/AnonymousAuthentication -name enabled -value true -location $name
    + CategoryInfo          : NotSpecified: (:) [Set-WebConfigurationProperty], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Microsoft.IIs.PowerShell.Provider.SetConfigurationPropertyCommand

It is unclear to me what could cause this error to begin with since it worked fine on the “accounts” website. Looking at google, some suggested to check if the website is using an application pool running with .NET 4. I verified that the script successfully sets this up.

How should I configure the authentication of an IIS website using Powershell?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T02:04:37+00:00Added an answer on May 31, 2026 at 2:04 am

    Have you tried the MS hot fix for IIS 7.5? It includes a fix for “You cannot use WMI to manage .NET Framework 4.0 configurations.” The hot fix solved the same Standard Endpoints error with WCF REST-ful service for Mike.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two websites on IIS 6 that throw server errors when they are
I have two websites OLD.com (classic ASP) and NEW.com (ASP.NET) - each site has
I have a very strange issue on my hands. I have two IIS websites
I have two IIS servers running using NLB. Unfortunatelly I cannot use shared session
I have to deploy my ASP.NET application into two seperated IIS servers. My application
I have two applications written in Java that communicate with each other using XML
I have an asp.net website that has been running well in IIS 6.0. I
I have two websites running on the same IIS instance on the same 2008
I have an application that is built using ASP.NET, with an embedded Silverlight Object
In our setup there are two different websites in IIS 7 setup that point

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.