Sign in to follow this  
Followers 0
HockeyFan

Need Help!

10 posts in this topic

Can someone help me with how to pull the logged on user's first and last name (Full Name) from their Local account information? I'm trying to prevent from having the user type the information themselves. :P

Share this post


Link to post
Share on other sites



Can someone help me with how to pull the logged on user's first and last name (Full Name) from their Local account information? I'm trying to prevent from having the user type the information themselves. :P

Autoit can know whatever your computer knows.

That information is probably in the registry. do a search in regedit for your last name and see what key it is saved as, then hae autoit read back that key.

My computer doesnt know my real name, so it wouldnt even be possible....

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

On most computers I've worked on, which have come pre-packaged from whatever store they bought it, you'd find that the majority of usernames on a system is just "Owner" (or such).

Very few users put their proper names as their usernames, in my experience. You'd be lucky to find their first name there.

Your best bet might be to check if they've got an installations of certain softwares and look for it there.

I searched the registry just now for my own last name and found it only once:

$LastName=RegRead("HKEY_USERS\S-1-5-21-1547161642-1677128483-1708537768-1006\Software\Apple Computer, Inc.\iPod\UserReg2\", "LastName")

You might, likewise, find it in MS Word's settings, etc.

I checked my OpenOffice installation - - it's got my last name in its user info, but doesn't seem to save that to the registry, and Search couldn't find it saved in any files.

I'm trying to add it to a few programs (Outlook, Thunderbird, etc) where I normally don't, just to see if it shows up in any INIs or the registry. If I find anything, I'll post it.

Edit: I remembered that Outlook would store its info in its PST (good luck sifting through that). Thunderbird saved it in its "prefs.js" file under my profile and, after creating an Outlook Express account with it in there, found it in:

HKEY_USERS\S-1-5-21-1547161642-1677128483-1708537768-1006\Software\Microsoft\Internet Account Manager\Accounts0000001

Your bottom line is that a lot of people have the savvy to not keep that info on their systems. Only place I've recently seen a username with first and last names has been in a workplace.

Edited by Xander

Share this post


Link to post
Share on other sites

All,

Thanks for the input. I guess I should have given more details about what I am trying to accomplish. :">

Yes, this is for a work enviromment where we use everyones First and Last name when creating accounts.

Good idea about searching through the registry...I'll see what I can find. :D

I am aware of the WMI information...but I'm not familiar with using any of it. :P

Thanks, I'll keep pushing forward. :)

Share this post


Link to post
Share on other sites

@UserName

That displays the UserName. But I'm not sure how you can get their first and last name, without storing it to a file then reading it.

Secure

Thanks...but in our environment the username ends up being the first letter of the first name and then the last name, strung together.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

the username ends up being the first letter of the first name and then the last name, strung together.

Well, getting the last name becomes easy enough.

$lastname=StringTrimLeft(@UserName,1)
"jsmith" becomes just "smith" and you could mess around with StringUpper to make just the first letter uppercase if you wanted.

Now, just find some place in the registry where everybody enters their first name (i.e. Outlook Express name?). You could parse it for the presence of spaces and crop just the first part. Thus, if someone's OE name is "John Smith", you could chop it down to just "John" and use the last part of the username as shown.

Edited by Xander

Share this post


Link to post
Share on other sites

Well, getting the last name becomes easy enough.

$lastname=StringTrimLeft(@UserName,1)
"jsmith" becomes just "smith" and you could mess around with StringUpper to make just the first letter uppercase if you wanted.

Now, just find some place in the registry where everybody enters their first name (i.e. Outlook Express name?). You could parse it for the presence of spaces and crop just the first part. Thus, if someone's OE name is "John Smith", you could chop it down to just "John" and use the last part of the username as shown.

Great stuff! We don't user Outlook Express, we use GroupWise...so I'm going to search the registry to see if I can come up with something there.

Thanks!!

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Your bottom line is that a lot of people have the savvy to not keep that info on their systems.

Too true, wasn't one macrovirus writer jailed on the basis of finding his name inside a Word document? Probably didn't even knowingly enter it, either.

I treat Microsoft programs on a MI5-style "Need to Know" basis.

HST, it would be useful to be able to pull this kind of info from a fileserver account. Since the user would be authenticated that doesn't raise so many security issues. Not sure how to achieve that, though. Clearly possible as Microsoft programs do so.

Edited by Selmak

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0