PDA

View Full Version : Resolve Full Username for Email Notification


kblaine
06-13-2006, 11:00 AM
I understand there is a %username% macro that will insert the logged on user name into the email notification.

Is there a way to qualify the FULL user name to insert into the email notification?

For example in the email notification I would like to put:

This build was built by %username% at %datetime%.
Where username would have Bill Smith, instead of the actual username that is logged in of smithb01.

I would assume we would have to do an AD lookup?
or
Is there a registry key that gives the full user name logged in?
or
Can I place a txt file on the drive that the macro will compare the smithb01 to equil Bill Smith?

Thank you!!

kinook
06-14-2006, 05:50 AM
[GetObject("WinNT://%COMPUTERNAME%/%USERNAME%,user").FullName]

http://tinyurl.com/oqldd

kblaine
06-14-2006, 09:19 AM
Not sure I follow what to do with that Get Object. Could I please get an example?

Is this the only way, by querying the AD directory?

thx.
-b

kinook
06-14-2006, 02:50 PM
That's a script expression you could use anywhere you would use a macro reference (i.e., %USERNAME%).
http://www.visualbuild.com/Manual/scriptexpressions.htm

There may be other ways to achieve this. It's just one way I found on a Google search.