• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 257
  • Last Modified:

resolve a logon name to a user name via Command Prompt

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
Danny Child
Asked:
Danny Child
  • 2
  • 2
  • 2
  • +1
3 Solutions
 
David LeeCommented:
Hi DanCh99,

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

Cheers!
0
 
Shane Russell2nd Line Desktop SupportCommented:
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
 
Eagle6990Commented:
net user /domain "username"
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
Danny ChildIT ManagerAuthor Commented:
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
 
Shane Russell2nd Line Desktop SupportCommented:
0
 
David LeeCommented:
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
 
Danny ChildIT ManagerAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 2
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now