2
votes

I'm trying to set the value of Enable32BitApplication and LoadUserProfile of an IIS app pool to True using PowerShell by running the following Cmdlets:

(Get-IISAppPool -Name DefaultAppPool).enable32BitAppOnWin64 = $True
(Get-IISAppPool -Name DefaultAppPool).ProcessModel.LoadUserProfile = $True

When I retrieve these values using PowerShell, it looks like the Cmdlets have run successfully, but when I try to check it in the GUI, I can note that it did not work. That's why I tried to test the website of the application pool in action, and I figured out that these Cmdlets does not work. Can anyone help me with the right PowerShell Cmdlets?

1
docs.microsoft.com/en-us/powershell/module/iisadministration/… If you don't commit changes, not surprised.Lex Li
Even when I commit, it does not workKrank

1 Answers

4
votes

In order for it to work by modifying the object returned by Get-IISAppPool you have to call Start-IISCommitDelay prior to changing the values and then Stop-IISCommitDelay after making the changes. So in your case it'd be:

Start-IISCommitDelay
(Get-IISAppPool -Name DefaultAppPool).enable32BitAppOnWin64 = $True
(Get-IISAppPool -Name DefaultAppPool).ProcessModel.LoadUserProfile = $True
Stop-IISCommitDelay