Freigeben über


HOWTO: Create Custom Application Pool from Commandline

Question

Hi,

I have a Web site configured to run in a custom application pool. The pool identify is set to a domain user.

I can change the users password using IIS Manager, but is there a command line method ?

Thanks

Answer

You can use the ADSUTIL.VBS tool to do this from the commandline (or steal the code from it for your own custom script).

The properties that you are interested in are all documented on MSDN at Metabase Properties.

The following is an example of how to create a new Application Pool called "MyAppPool" and configure it to use a custom Application Pool identity of domain\username with a password of pass. You can find all the property syntax and valid values in the MSDN. Remember, if you want to use the space character as a parameter, you have to put it in double-quotes since the commandline processor uses space as parameter delimiter.

 
CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\ADSUTIL.VBS CREATE w3svc/AppPools/MyAppPool IIsApplicationPool
CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\ADSUTIL.VBS SET w3svc/AppPools/MyAppPool/WamUserName "domain\username"
CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\ADSUTIL.VBS SET w3svc/AppPools/MyAppPool/WamUserPass "pass"
CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\ADSUTIL.VBS SET w3svc/AppPools/MyAppPool/AppPoolIdentityType 3

//David

Comments

  • Anonymous
    December 13, 2007
    The comment has been removed

  • Anonymous
    March 27, 2008
    Scripting an ASP.NET installation in Win2k3

  • Anonymous
    September 25, 2008
    The comment has been removed

  • Anonymous
    September 28, 2008
    bob - You need to modify the AppPoolId property of the specific application in the website. It is a one-liner, so please make the effort to figure it out. //David

  • Anonymous
    July 23, 2009
    The comment has been removed

  • Anonymous
    December 06, 2009
    Hi mister, how can I detect if apppool is created or not ?? thanks in advanced.

  • Anonymous
    December 06, 2009
    Hi mister, how can I detect if apppool is created or not ?? thanks in advanced.

  • Anonymous
    December 27, 2009
    Hi all, can I create apppool in remote computer ?? thanks !!! I use XP and I want create AppPool in W2003 R2 . greetings

  • Anonymous
    February 04, 2010
    I've set the app pool pasword several times using the above, but have never had the password work, until it is manually re-entered. Do you have any thoughts why the passwords are not working? Thanks.

  • Anonymous
    June 07, 2011
    Hi, I managed to create and edit application pools using ADSI and pstool (psexec.exe) to run remote commands on remote servers. Works like a charm. Thanks for the code David. The only reason I am using adsutil is to set a .php extension to 5.3, sadly I couldn't accomplish this via ADSI.

  • Anonymous
    November 20, 2011
    "bob - You need to modify the AppPoolId property of the specific application in the website. It is a one-liner, so please make the effort to figure it out. //David" It makes me sick when I see people do this. You know the answer to a person's question, but instead of simply providing that short answer, you take the time to tell them to go work it out for themselves. What a hero you are David. I hope the next time you ask someone for help in any aspect of your life, they give you the finger and send you on your way.

  • Anonymous
    September 10, 2012
    2012-09-10 16:52:56 192.168.48.71 3194 192.168.0.58 80 - - - - - Timer_ConnectionIdle - 2012-09-10 16:57:06 192.168.48.71 3199 192.168.0.58 80 - - - - - Timer_ConnectionIdle - 2012-09-10 19:30:21 41.190.90.60 43847 192.168.0.58 80 HTTP/1.1 POST /Mobilereg.aspx 400 1253087526 BadRequest DefaultAppPool 2012-09-10 19:44:14 41.190.90.60 56667 192.168.0.58 80 HTTP/1.1 POST /Mobilereg.aspx 400 1253087526 BadRequest DefaultAppPool

  • Anonymous
    June 10, 2014
    Here is the complete solution with screenshots and easy steps. solutions-ever.blogspot.com/.../how-to-create-application-pool-in-iis.html