SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have for example "User1" and "User2" and ...
I want that when "User1" logins to the site home page show "Hello User1" and when "User2" comes, it show "Hello User2"
Can anyone help me?

share|improve this question
Can you provide a bit more information? Where do you want it? on the masterpage? in a webpart? ... – Ruben Herman Nov 15 '12 at 12:21
Yes... On my masterpage. – MRAramesh Nov 15 '12 at 12:25
What kind of login do you; FBA? Windows login? TMG? – Daniel Ziga Nov 15 '12 at 12:34
I don't know... How should I find it? – MRAramesh Nov 15 '12 at 12:40
What area do you want this to display? On the ribbon? On the page under the page title, etc? Can you do a screen shot of the page and where you want it and I will tell you how to achieve it. If it is in the ribbon, you need to just simple inject hello before the user name which selected "Preferred Name" first, if you want it in page, you make a simple user control and place it in the correct place, if you want it in the title, then it is also a similar process. Where do you exactly want it to appear? – Hugh Wood Nov 15 '12 at 13:53

I guess the most easiest way I know is to show it by JavaScript using SPServices. Look to SPServices documentation and examples for getting current user. This way allows to do that without extra server side codding.


var thisUserName = $().SPServices.SPGetCurrentUser({
fieldName: "Title",
debug: false

Then put thisUserName where you need.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.