Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


how to display user's first/last name

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,38442
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> how to display user's first/last name
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 how to display user's first/last name - 10/6/2006 6:28:40 AM   
  Brian32

 

Posts: 14
Score: 0
Joined: 7/13/2005
Status: offline
Hi.

I have a simple script that displays the current user's logon name, like jdoe for John Doe:

Set objNetwork = WScript.CreateObject("WScript.Network")
MsgBox objNetwork.UserName

How do I display the current user's first and last name instead of their logon name?

Running XP Pro in a Windows 2003 Active Directory domain. Thanks.
 
 
Post #: 1
 
 RE: how to display user's first/last name - 10/6/2006 6:38:18 AM   
  esnmb

 

Posts: 448
Score: 0
Joined: 1/11/2005
From: USA
Status: offline
From the MS Script Center:
http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true

On Error Resume Next

Set objUser = GetObject _
("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com")


WScript.Echo "First Name: " & objUser.givenName
WScript.Echo "Initials: " & objUser.initials
WScript.Echo "Last Name: " & objUser.sn
WScript.Echo "Display Name: " & objUser.displayName
WScript.Echo "Office: " & _
objUser.physicalDeliveryOfficeName
WScript.Echo "Telephone Number: " & objUser.telephoneNumber
WScript.Echo "Email: " & objUser.mail
WScript.Echo "Home Page: " &

For Each strValue in objUser.description
WScript.Echo "Description: " & strValue
Next

For Each strValue in objUser.otherTelephone
WScript.Echo "Other Telephone: " & strValue
Next

For Each strValue in objUser.url
WScript.Echo "URL: " & strValue
Next

(in reply to Brian32)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> how to display user's first/last name Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts