Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Get Windows logged in user name on a network

836525Feb 4 2011
Hi All,

My requirement is to get the windows logged in user name.

I'm using a computer on a LAN (network).

I used to log in to windows using the user id , say admin.
Once after successful login , we could see the logged in user name on the left top of the pop up , which comes when we click the "*start*" button.
Here , its showing say Administrator

So by using System.getProperty("user.name"); i'm getting the value admin.
[ The same value will be returned , if we use the Java 1.5 statement --> +new com.sun.security.auth.module.NTSystem().getName()+ ]

My question is , how can we retrieve the value Administrator in my java code.



I have no idea on how to add images to the threads. If some one knows..please do reply me so that i can attach the images which will make the problem more clear
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 4 2011
Added on Feb 4 2011
0 comments
185 views