How can you change an IIS Site's App Pool with the Powershell Web Admin Commandlets How can you change an IIS Site's App Pool with the Powershell Web Admin Commandlets powershell powershell

How can you change an IIS Site's App Pool with the Powershell Web Admin Commandlets


ApplicationPool is a property on the web site in the IIS: drive. Set it like so:

#site levelSet-ItemProperty 'IIS:\Sites\Default Web Site' applicationPool ProjectAppPool#app levelSet-ItemProperty 'IIS:\Sites\Default Web Site\AppName' applicationPool ProjectAppPool

If you have the PowerShell Community Extensions installed, you can use the Show-Tree command to explore these drives e.g.:

Show-Tree IIS:\Sites -ShowProperty -Depth 1