Lets say I have a website called "MyApp" that exists on the wwwroot folder in iis. I also have an app pool called "AppPool2" that I want to move "MyApp" to this app pool.
Is it possible to my my website to AppPool2 with a bat file or a powershell command?
Try this:
C:\Windows\System32\inetsrv>appcmd set app "Default Web Site/MyApp" /applicationPool:AppPool2