search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Creating IIS7 Application Pool with Powershell
Posted in Hosting & IIS7, Windows Powershell | 1 Comment | 7,130 views | 16/12/2010 21:49

Powershell function to create a new application pool in IIS7.

1
2
3
4
5
6
7
8
9
10
11
Function Create-AppPool
{
Param ($AppPool, $Username, $Password)
 
    New-Item IIS:\AppPools\$AppPool
    $NewPool = Get-Item IIS:\AppPools\$AppPool
    $NewPool.ProcessModel.Username = "$Username"
    $NewPool.ProcessModel.Password = "$Password"
    $NewPool.ProcessModel.IdentityType = 3
    $NewPool | Set-Item
}

You can set IdentityType for Network Service. Please check Technet for IdentityTypes.


Comments (1)

Mustafa

April 27th, 2011
18:00:55

This will work when you import webadministration module.
So firt run this cmd
PS$> import-module webadministration



Leave a Reply