Does URLRewrite support scripts or command lines to realize one click deployment? RRS feed

  • Question

  • User-498421887 posted

    I have used URLRewrite tool to remove "Server", "X-Powered-By", "X-AspNet-Version" from response headers. However, consider about deploying automatically, can I do the same thing by scripts or command lines?

    Wednesday, July 17, 2019 6:22 AM

All replies

  • User-2106141979 posted

    You wish to deploy UrlRewrite to multiple IIS servers remotely / automatically?

    If so, you can use Web Platform Installer to install packages from the command line with a command like:

        webpicmd /Install /Products:ARRv3_0 /AcceptEULA

    You do have Web Platform Installer installed on your IIS servers right?

    If your IT Operations team uses something like Ansible this should be easy to script to run on your web farm. If they don't and you need to do it yourself, you can use msdeploy to execute it on the server:

        msdeploy /verb:sync /source:runCommand="webpicmd /Install /Products:ARRv3_0 /AcceptEULA" /dest:auto,computerName="server1"

    This assumes you have the Web Deployment Service installed (msdepsvc) installed and running on the remote machine, and are logged in locally with an AD or Local account that exists on the remote machine as an Administrator or as a member of a MS Deploy group whose name I can never remember.

    If you are using Web Management Service instead (wmsvc) - which typically listens on port 8172, you can do something like the following to manage remote IIS servers:

        msdeploy /verb:sync /source:runCommand="webpicmd /Install /Products:ARRv3_0 /AcceptEULA" /dest:auto,wmsvc="server1",authype=ntlm  -allowUntrusted

    You will need the allowUntrusted by default unless youve made the effort to configure Web Managment with an explicit certificate that you deploy the public certs for. Leave off the authtype and pass an explicit username and password and it'll do a basic auth instead with the provided creds.

    Wednesday, July 17, 2019 1:43 PM