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

  • Home
  • SEARCH
  • 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 6771847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:28:52+00:00 2026-05-26T15:28:52+00:00

I am using the IIS Powershell snapin to configure a new web application from

  • 0

I am using the IIS Powershell snapin to configure a new web application from scratch. I am new to PS. The following script will not workl as PS is not recognising the ManagedPipelineMode enum. If I change the value to 0 it will work. How can I get PS to understand th enum. I tried the Add-Type cmdlet and also load the Microsoft.Web.Administration assembly without any scuccess, these lines are now commented.

How can I get this PS script working with the enum ?

#Add-Type -AssemblyName Microsoft.Web.Administration
#[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration")
Import-Module WebAdministration

$AppPoolName = 'Test AppPool'

if ((Test-Path IIS:\apppools\$AppPoolName) -eq $false) {
    Write-Output 'Creating new app pool ...'
    New-WebAppPool -Name $AppPoolName
    $AppPool = Get-ChildItem iis:\apppools | where { $_.Name -eq $AppPoolName}
    $AppPool.Stop()
    $AppPool | Set-ItemProperty -Name "managedRuntimeVersion" -Value "v4.0"
    $AppPool | Set-ItemProperty -Name "managedPipelineMode" -Value [Microsoft.Web.Administration.ManagedPipelineMode]::Integrated
    $AppPool.Start()

}

The error message is:

Set-ItemProperty : [Microsoft.Web.Administration.ManagedPipelineMode]::Integrated is not a valid value for Int32.

  • 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-26T15:28:52+00:00Added an answer on May 26, 2026 at 3:28 pm

    It is expecting an integer, even though the underlying property is of type ManagaedPipelineMode. You can do below however:

    $AppPool | Set-ItemProperty -Name "managedPipelineMode" -Value ([int] [Microsoft.Web.Administration.ManagedPipelineMode]::Classic)
    

    PS:

    Instead of

    $AppPool = Get-ChildItem iis:\apppools | where { $_.Name -eq $AppPoolName}
    

    you can do:

    $AppPool = Get-Item iis:\apppools\$AppPoolName
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I create an Application Pool on IIS 6.0 using a PowerShell script?
We're currently using IIS 6 and Windows Server 2003 for our web and application
I am using IIS V5.1. Integrated windows authentication I have a following web config:
How do I export a self-signed certificate from IIS 7 using PowerShell?
I have a web application which I uploaded using IIS. I want the users
I'm using powershell to create a web site in IIS. One of the requirements
I'm using IIS and trying to deploy a web application that needs authentication mode=Windows.
I am working on a PHP application using IIS Express/Web Matrix and it is
I am using IIS 7.0 + Windows Server 2008. Anyone has experience to configure
I'm using the PowerShell script below to set anonymous user identity and authentication methods

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.