Jump to content

Need Help!


Recommended Posts

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....

Link to comment
Share on other sites

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
Link to comment
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. :)

Link to comment
Share on other sites

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
Link to comment
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!!

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...