How to set application pool application id using web administration module in powershell?

I use powershell to automate the configuration of websites in my IIS. I have the following code that creates a web application pool for me

#Creating a new Application Pool
New-WebAppPool "NewAppPool"

How do I configure the application pool id to "Network Service" from my script?

Please note: there is no IIS disk on my system. And therefore, the commands that have IIS mentioned in the path are, for example, the following:

Set-ItemProperty IIS:\AppPools\NewAppPool -name processModel.identityType -value 2
+1
source share
1 answer

WebAdministration PowerShell IIS. IIS , , IIS: C: .

, :

    New-Item IIS:\AppPools\$AppPool
    $NewPool = Get-Item IIS:\AppPools\$AppPool
    $NewPool.ProcessModel.Username = "$Username"
    $NewPool.ProcessModel.Password = "$Password"
    $NewPool.ProcessModel.IdentityType = 2
    $NewPool | Set-Item

, WebAdministration:

Set-ItemProperty IIS:\AppPools\NewAppPool -name processModel.identityType -value 2

, .

+1

Source: https://habr.com/ru/post/1674169/


All Articles