Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

resolve a logon name to a user name via Command Prompt

Posted on 2005-04-15
7
Medium Priority
?
246 Views
Last Modified: 2008-03-17
Hi,
is there a funky tool somewhere to resolve a logon name to a user name at a command prompt?  I'm using PSLOGGEDON from pstools - http://www.sysinternals.com/ntw2k/freeware/pstools.shtml - to help with an inventory at a new role I've just got.  

It would be handy if I could stay in the command prompt session and find the user's full name, rather than their logon ID.  Pasting it into a new mail message and Ctrl+K to Check Names works, as the mail alias is often the same, but it's a bit tedious.  Might come in handy for batch files too...

tia - Danny.
0
Comment
Question by:Danny Child
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 13792352
Hi DanCh99,

If your servers are W2K or W2K3, then is a small VBScript an option?

Cheers!
0
 
LVL 23

Expert Comment

by:gecko_au2003
ID: 13792419
You mean something like this :

http://vbnet.mvps.org/index.html?code/network/netusergetinfo.htm

I know that is in visual basic but I think that is what you were looking for, not entirely sure ? If it wasnt them I am sorry !!
0
 
LVL 17

Accepted Solution

by:
Eagle6990 earned 600 total points
ID: 13792648
net user /domain "username"
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Author Comment

by:Danny Child
ID: 13800473
Eagle6990 - looks good, I'll give it a spin when I'm in work again tomorrow!
Gecko - Could be a handy tool, maybe a bit too much for now - but I'll give it a go too.  
BlueDevilFan - vbs is an option, and yes - servers are 2k.

cheers, Danny
0
 
LVL 23

Assisted Solution

by:gecko_au2003
gecko_au2003 earned 200 total points
ID: 13800482
0
 
LVL 76

Assisted Solution

by:David Lee
David Lee earned 200 total points
ID: 13801447
Here's a simple script that'll display the user's full name.  The script requires the user's domain and username to function.

strDomain = Wscript.Arguments(0)
strUsername = Wscript.Arguments(1)
Set objUser = GetObject("WinNT://" & strDomain & "/" & strUsername & ",user")
Wscript.Echo objUser.FullName
Set objUser = Nothing
0
 
LVL 23

Author Comment

by:Danny Child
ID: 13811528
Eagle6990's suggestion is the cleanest one out of the box, but I like the others too, so I've gone for the split.  
Much appreciated.
Danny
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
It is only natural that we all want our PCs to be in good working order, improved system performance, so that is exactly how programs are advertised to entice. They say things like:            •      PC crashes? Get registry cleaner to repair it!    …
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question