Windows Server 2016 Optimisation Script

Windows Server 2016 Optimization Script.

Tested on: Windows Server 2016 build 14393.0.

Description: This script disables services, removes  scheduled tasks and imports registry values to optimise system performance on Windows Server 2016 running in a Citrix SBC environment.

Warning: This script makes changes to the system registry and other configurational change  and as such a full backup of the machine or # snapshot if running in a virtual environment is strongly recommended. Carry out full testing before introducing image to production.

Note: You should review ALL optimisations this script makes and determine if they fit in to your environment. Not every optimisation suits all environments. For example, this script disables key Hyper-V services for use in non-Hyper-V environments. If you use Hyper-V, you must enable these services.

Instructions: To avoid failure, run PowerShell as an administrator.

Download (click below):

Windows Server 2016 Optimisation Script (687 downloads)

Any problems with the script or if you want to make your own improvement suggestions then comment below.

Open the script using a text editor or PowerShell ISE to see what exactly the script does.

This script is not signed so when downloading you may receive a “Publisher could not be verified” message, this is generally only appearing on Internet Explorer and not the likes of Google Chrome. You can still download and run the script regardless.


19 Comments

  • Steve Elgan

    April 14, 2017

    Great script. You may want to consider setting power to high performance and also disabling Server Manager task.

    Reply
    • George Spiers

      April 15, 2017

      Thanks. I did consider including disabling Server Manager on startup at the time however that is an HKCU key. I’ve included High Performance.

      Reply
  • RICHARD HUGHES-CHEN

    May 18, 2017

    Was looking for some 2016 optimizations to test in my POC.

    If using Citrix App Layering would it be best to run in the OSLayer or as another layer?

    There seems to be a similar script configured with Citrix App Layering in the OS machine tools scripts folder C:\windows\setup\scripts\Optimize.html

    What is the best thing to do?

    Reply
    • George Spiers

      May 18, 2017

      Run optimisations in the OS Layer. The script I provide is specifically for Windows Server 2016 and does contain a tonne of optimisations that have been checked and evaluated thoroughly. The Optimisation builder you mention does contain probably the same optimisations that my script has but not as many.

      Reply
  • eltjo

    May 19, 2017

    Hello George,

    how does your script compare the Base Image Script Framework (BIS-F) that Login has released?

    Regard,

    Eltjo

    Reply
  • George Spiers

    May 19, 2017

    BIS-F can run defragmentations, clean out profiles, rearm Office, run Antivirus etc. and many other preparation type tasks. My script is purely disabling Services, disabling Scheduled Tasks, removing Active Setup, decreasing Event Logs size and much more to get the best performance out of your image.

    Reply
    • Matthias Schlimm

      June 14, 2017

      You can use this Optimization Script in a combination with BIS-F, copy it to the custom preparation folder in BIS-F and it would be automatically executed if you BIS-F starts.

      Reply
    • George Spiers

      May 31, 2017

      Thanks – I had a review. I’m going to include 8 more services to be disabled. The document also says to disable some services but I’m not going to disable via the script. Examples are Print Spooler (required to see printers so not wise to disable). The document also doesn’t specify to disable services such as Remote Access Connection Manager. My script disables it since there is no need to manage dial-up and VPN connections. Also the script disables superfetch (service that improves performance over time) – not useful for stateless machines.

      Reply
      • Steve Elgan

        May 31, 2017

        Cool. What are your thoughts on configuring the script in such a way that you can pass a variable for a Citrix config vs. just a general 2016 server config? Right now I just comment out lines that are specific to Citrix workloads when I want to use it on a general 2016 server. I’m still learning PoSh but i’d be willing to work up a PoC for you to review.

        Reply
        • George Spiers

          May 31, 2017

          The script is focused on SBC regardless of whether the image is deployed via Citrix, RDS, VMware. Everyone’s taste will be different in terms of what to keep and remove. That is why I think it’s easier to suggest that each person reviews what this script does and then remove or comment out lines to their liking.

          Reply
      • RICHARD HUGHES-CHEN

        June 1, 2017

        Hi George, have you included the additional services to be disabled in the script? Thanks

        Reply
        • George Spiers

          June 1, 2017

          Hey. Yes they are included now.

          Reply
  • RICHARD HUGHES-CHEN

    June 1, 2017

    just noticed the comments around Hyper-V which is what I am using.

    # in non-Hyper-V environments. If you use #

    # Hyper-V, you must enable these services.

    Reply
    • George Spiers

      June 1, 2017

      That’s right. Edit the script and remove the lines relating to disabling Hyper-V services.

      Reply
  • Jochen

    June 23, 2017

    Hello,
    I used this script in my test environment and it is great, Much more responsive Xenapp Server.
    The only thing I have now is that during logon I am stuck for about 20-30 seconds on the following message: please wait for user profile service.
    After this everything is lightning fast.
    Any idea why i have to wait for the user profile service? (We use roaming profiles)

    Reply
    • George Spiers

      June 23, 2017

      Thanks for the feedback. Have you tried taking roaming profiles out of the equation to see if it still occurs? That would be my first action, pick a machine, put it in maintenance mode, disable roaming profiles and test.

      Reply
  • Frank

    July 10, 2017

    hi george
    i take also bis-f script from matthias schlimm, and now there is the CTXOE supported. so your script is awesome, but did you test if CTXOE make the same now, or did you make some additional special things, so that both scripts will be good for optimization?
    regards
    frank

    Reply
    • George Spiers

      July 10, 2017

      The Citrix Optimizer tool has 71 different types of optimisations for Windows Server 2016. The script here has 170+ different optimisations. There are about 5-7 different unique optmisations in Citrix Optimiser with the majority of those left out of my script intentially. So my script has 90% of optimisations that are included in the Citrix Optimizer tool but around 80+ additionals. For example Citrix Optimizer does not disable Xbox related Scheduled Tasks whereas my script does. You are safe to use both, which I highly recommend.

      Reply

Leave a Reply