Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a script update the Identity tab fields of Application Pool properties in IIS 6.0+

I am a developer and I have arrived at a solution to a webservice authentication problem that involved ensuring Kerberos was maintained because of multiple network hops. In short:

  • A separate application pool for the virtual directory hosting the webservice was established
  • The Identity of this application pool is set to a configurable account (DOMAINname\username which will remain constant but the strong password is somehow changed every 90 days I think); at a given point in time, the password is known or obtainable somehow by our system admin).

Is there a script language that could be used to setup a new application pool for this application and then set the identity as described (rather than manual data entry into property pages in IIS)?

I think our system admin knows a little about Powershell but can someone help me offer him something to use (he will need to repeat this on 2 more servers as the app is rolled out). Thanks.

like image 348
John Adams Avatar asked Sep 21 '11 16:09

John Adams


1 Answers

You can use such PowerShell script:

Import-Module WebAdministration
$appPool = New-WebAppPool -Name "MyAppPool"
$appPool.processModel.userName = "domain\username"
$appPool.processModel.password = "ReallyStrongPassword"
$appPool.processModel.identityType = "SpecificUser"
$appPool | Set-Item
like image 193
Petr Felzmann Avatar answered Oct 03 '22 07:10

Petr Felzmann