How to Silently Renew the Evaluation License for Windows Server

home lab example

Today, we’re going to talk about how to automatically renew the Evaluation License for Windows Server. If you are anything like me, you like to make your life easier. Personally, I’m a fan of automating just about anything I can. One example that recently came to mind for me was with my home lab setup. Now, I plan to start it from scratch with some new hardware I got, so it got me thinking. I’m planning on running at least a few Windows Servers, so why not run the trial versions for as long as I can. Its a great way to experiment with the same stuff I use every day, without breaking the bank.

Microsoft offers evaluation versions of operating systems, free of charge. This is perfect for a Home Lab Pro because running a home lab can be expensive enough without having to buy software licenses too! The Microsoft Evaluation Center is the perfect place to get an evaluation license of Microsoft Windows Server operating systems for free. This can be great if you are just starting out and want to learn how to spin up Active Directory, or for seasoned pro’s you may want to test out a configuration change in a safe, non-production environment. In either case, free software is right for you.

DISCLAIMER

Please understand that the content herein is for informational purposes only. This existence and contents shall not create an obligation, liability or suggest a consultancy relationship. In further, such shall be considered as is without any express or implied warranties including, but not limited to express and implied warranties of merchantability, fitness for a particular purpose and non-infringement. There is no commitment about the content within the services that the specific functions of the services or its reliability, applicability or ability to meet your needs, whether unique or standard. Please be sure to test this process fully before deploying in ANY production capacity, and ensure you understand that you are doing so at your own risk.

Additionally, given that this is an evaluation trial, you must understand the implications of trying this in a production environment. Please understand that you are likely violating the EULA and are likely liable for penalties from Microsoft. Please Use this for a Home Lab ONLY!

Table of Contents

How to Find Remaining Trial Length
Configure Task Scheduler for Windows Server License Renewal
Export Task Template for Other Servers
Conclusion

How to Find Remaining Trial Length

Windows Server allows for a 180-day trial (which is really a fantastic trial). However, if you plan to have your home lab for a long time, you may not want to set up the entire environment every 180 days. Fortunately, Microsoft will allow you to extend the trial, for free, up to 6 additional times leading to 3 years of a free trial! When you think about how much companies have to pay Microsoft for access to this software, I’d say this trial is pretty generous. Trick is, you have to remember to renew it. Today, we’re going to figure out how to take memory out of the equation.

When working with a trial license for Windows Server, the Software License Manager (slmgr.vbs) is the tool for understanding how much time you have left and is also used to renew the trial. For this example, I’m running Windows Server 2022 evaluation. To manually check your license time, run this command:

slmgr /dlv

This should display a pop-up window looking similar to this:

server license manager dialog box
Server License Manager Dialog Box

As you can see, my Windows Server 2022 evaluation is brand new. I general, I want to build this on a test server, so I don’t use any activations on a server that I am planning on keeping for a long time. This helps when you aren’t sure how much time you have left on the evaluation copy.

Now, to manually renew it, we can run this simple command, and then reboot the server.

slmgr /rearm

If you remember though, we want to automate this, so we don’t have to remember to do this. So instead, we will write batch file and use Task Scheduler to do this for us.

Configure Task Scheduler for Windows Server License Renewal

First, we need to write the batch file. In general, this is pretty straight forward.

Create the Batch File

  1. Navigate to C:\ Drive and create a folder name “Temp”. (This can be anywhere, it is just an example).
  2. Inside of C:\Temp, right-click and create a new file called “Rearm.bat”. You may be prompted about changing the file extension. Just hit ok. If you do not see the warning, check and make sure that you have the folder options set to “Show Extensions for Known File Types” and you can make sure you actually change the file extension.
file explorer to rename the batch file

3. Right-click the file, and edit it to look like the text below. Alternatively, you can copy/paste the script linked HERE. Save this file, and open Task Scheduler.

Rearm.bat Script

Create the New Task

4. In Task Scheduler, you want to Create a New Task. Give it a title you will recognize, and change it to “Run whether user is logged on or not”. (This will ensure you don’t have to be logged in for the task to run, since it will only run twice a year!). I recommend creating a Service Account for this, as the task will fail if the password gets changed.

create task to renew license for windows server
Create a Task

5. Next, we will configure the Trigger. Click the Trigger tab, and configure it using the settings below. (Adjust the dates to match what works for you.) The main thing is that it runs once every 6 months. So mine is configured to run April 7th, and October 7th, each year. I also recommend running this during a time when you aren’t likely to have something running. Best to avoid disruption to your other services. (Planning maintenance is an important part of every IT Admin, even in a home lab!)

set trigger schedule for rearm task
Trigger Tab View

6. After that, you will want to create an action. Hit browse, and navigate to the location where you saved your rearm.bat file, and choose that for the action.

specify actions to renew license for windows server
Add an Action Tab

7. For the Conditions, Settings and History tabs, you can leave these as default. Feel free to look through and change any settings to your liking. I left them as they weren’t required for this to work. Hit OK once you are done, configuring the task, and enter the password for the account.

cache credentials to ensure task runs

Test the Task

8. Now if you want, you can use Task Scheduler to run this on-demand as a test. However, since I’d hate for you to waste an activation, I ran it and here is the before and after.

pre-run shot of the not yet activated license
Before
successful license activation after the scheduled task
After

That’s it! You have now configured Task Scheduler to automatically renew the Evaluation License for Windows Server. This should save you some time in the future and reduce the need for manual re-activations. Now you can focus on the important things, like learning new skills in your home lab! Find other ways to automate the tedious stuff so all your efforts can go towards the fun stuff.

Export the Task for Use with Other Servers

Now that the hard part is done, lets export this task, so we can save that and the rearm.bat file for use on other servers. Why manually duplicate the work when you can just copy / paste and import this wherever you need.

  1. From within Task Scheduler, select the “Rearm” task, and on the right-hand side, hit “Export”.
task scheduler export menu
Task Scheduler – Export Option
  1. Choose a location to save the exported file.
  2. Copy both the exported file and the Rearm.bat file to a new location (Network Storage) or some place where you can move it to any other servers you want to Configure.
  3. Open Task Scheduler on the new Server, and hit “Import Task” on the right-hand side again.
Task Scheduler - Import Option
Task Scheduler – Import Option
  1. Select the “Rearm” task you exported from the previous server. (Be sure to also save that Rearm.bat file to the same location as the previous server.
  2. Update settings like the passwords, and any dates for the trigger.
  3. Save the task.
  4. Repeat as needed for other servers in your environment.

Conclusion

Ultimately, this is a quick an easy way to ensure that you keep your evaluation license for windows server. It also means that you continue to get the most out of your home lab without having to purchase as many licenses. I hope you found this useful and that it saves you some time. I’ll be looking to leverage similar methods like this for time savings in the future. I’m a firm believer in automation, and I can’t wait to share other ideas with you all as I go along. Be sure you check out other posts below related to automation and running a home lab.

Hit me up on Twitter @SeeSmittyIT to let me know what you thought of this post. Thanks for reading!

Smitty

Curtis Smith works in IT with a primary focus on Mobile Device Management, M365 Apps, and Azure AD. He has certifications from CompTIA and Microsoft, and writes as a hobby.

View all posts by Smitty →