Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use Powershell to make changes to Application Request Routing (ARR) in IIS7?

I'm working on some scripts to automate deployments. I use IIS7 ARR to load balance between two servers.

When doing a deployment I take one of the two out of load balancing and my powershell script deploys code to that server so I can test it before making it live.

It would be awesome if the script could also do the work of taking the server out of balance and putting it back in as it would save me having to open another remote desktop connection :)

Is this possible? If so, anyone have any examples?

like image 209
spilliton Avatar asked Dec 03 '22 13:12

spilliton


1 Answers

To enable ARR proxy using Powershell, just run the following...

Application Request Routing - Enable Proxy

 Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'  -filter "system.webServer/proxy" -name "enabled" -value "True"

To modify ARR, just use Configuration Editor in IIS Manager and click Generate Script under the Actions menu.

like image 54
SliverNinja - MSFT Avatar answered Dec 06 '22 01:12

SliverNinja - MSFT