I have an application written in Java that needs to run under another windows user account each time. My question is - is it possible to automatically create and switch windows user accounts using Java? For example, suppose I create two local user accounts - one called "test12" and one called "test123" and I'm logged in to "test123" - I need to be able to switch to "test12" and then back to "test123" (or a different account) purely using Java. Is this possible? How?
I understand there are several question on SO that address this issue however I've only seen the question in C# or .net not in Java (For example, the following question Is it possible to Switch User Accounts programmatically? was asked in C# and the question Create Windows User programmatically c# .net (using PricinpalUser / CreateProfile) was asked in c#)
I am using windows 8 however I wanted the application to be able to run on Windows server 12 as well (if possible).