Previous
Left Arrow
Enable PowerShell Remote Access Across All Nodes in your Server Farm
Current Code Entry
Next
CFF Coding Source - 
Using PowerShell to set our websites to only use HTTPS
  • Using PowerShell to set websites to only use non-www instead of www

    Article Entry Date: April 17,2026 @ 08:25:04 / Last Updated On: April 17,2026 @ 08:52:07
In this Article, we will look at a script that sets all websites to use non-www instead of www.


When I first got into designing websites, the long domain names and having WWW at the beginning meant you were a professional website.
Today, it is the shorter domain names and the non-www that make your website stand out.
This script will update your applicationHost.config file to work for all your websites. (Make a backup of your config before running this script, in case something goes wrong.)


I ran this on one of my [ARR Servers] ([Application Request Routing]), which is in a [Shared-Configuration] with several others.
Once you update one, all get updated.
Since the ARR is the [Front-End], and the Web Server is the [Back-End], we only need to apply this to our ARR Front-End servers.


For some reason, I received the following error, even though I am the Administrator.
Error
Restart attempt failed. Access denied, you must be an administrator of the remote computer to use this
command. Either have your account added to the administrator local group of
the remote computer or to the domain administrator global group.

Running this resolved the iisreset issue.

Other Articles Related to this Entry.


Using PowerShell to set our websites to only use HTTPS«