0

I want to create an application in java that is monitoring logged users activities(create, delete, update folders/files). The problem is that I didn't found how to get the OS of the logged user (java app is running on a windows server and users have windows on their machine, I want to know if there is a way to get the windows version of the logged users).

BRs, Mihai

Mihai Catan
  • 106
  • 9

3 Answers3

0
System.getProperty("os.version")

If it's a web application you can use user-agent header. It can change easily, but worth to try. Check https://stackoverflow.com/a/1328393/5684110.

Community
  • 1
  • 1
0

You would use JNI and call a native (windows-specific DLL) method to get the information. You would have to create this DLL yourself in (likely in C/C++)

Eyal Cinamon
  • 939
  • 5
  • 16
0

You're asking for a Windows-specific feature. I doubt Java would support that, so you will need a native module (written in C/C++ or something) to read that information and pass it into your Java application via JNI or a local socket connection. Maybe you could poll that data from Active Directory.

Another idea is, you could get the info through another Java app running on the client PC at startup. That way you would be able to monitor changes in the file system and some basic system properties like OS name and version (see Mustafa's answer). The app would be silently downloaded into the workstation and run automatically through Active Directory, sending the data to your server app via socket, web or a webservice.

Hope this helps you.

DragShot
  • 341
  • 2
  • 10