Auditing for Java on Windows Servers

In the first half of 2019 Oracle decided to change their licencing model for Oracle Java SE. FAQs

This was a shock for large and small companies alike. They have been using Java on workstations and servers for years and now all of a sudden Oracle is requesting your licence your environment. For many companies this would mean licencing entire data centres based on the physical CPU cores. This could easier mean hundreds of thousands or millions to licence.

For our Windows servers we wanted to see the extent Java was installed and used in the company. I created the following script to create a report and identify on which servers java is installed and which have java running as a process.

Script link

To run the script effectively it is assumed that you have an environment where all servers are available over the network to run remote commands and you are running the script with and privileged account about to invoke remote commands on servers.

Start PowerShell and run the script. It will take a while to connection to all the servers and pull back the info about java. Depending on the network and number of servers it could take minutes or hours.

The results will be exported to a CSV file that can be imported into Excel.

Once imported correctly using the Text to Columns feature

and comma as the delimiters


The results look something like this

You can then filter on these Columns to get the information you’re looking for. One caveat, servers running Javascript applications like node.js may have Open JDK installed and will return the process as true with java installed as false. These cases can be excepted because Open JDK is still free to use.

You May Also Like

About the Author: Phil

Leave a Reply

Your email address will not be published. Required fields are marked *