How to get the current user logged into Sharepoint

the following snippet get the current user lgged into Sharepoint and displays his/her Name, Login name, Email and all the groups he/she belongs to.

try {SPWeb web = SPControl.GetContextWeb(Context);SPUser sUser = web.CurrentUser; string str = "Name:" + sUser.Name + "<BR>"; "Login Name :" + sUser.LoginName + "<BR>"; "Email:" + sUser.Email + "<BR>"; "Groups:" + sUser.Groups.Count + "<BR>"; foreach (SPGroup grp in sUser.Groups) { " * " + grp.Name + " total Members:" + grp.Users.Count + "<BR>"; catch (Exception ex) { "No Current User" ;

 

 

 

 

 

str +=

str +=

str +=

 

 

str +=

}

lblInfo.Text = str;

}

 

lblInfo.Text=

}

Comments

# re: How to get the current user logged into Sharepoint
Gravatar In a few seconds herwow power leveling tears stopped and she closed those eyesbuy wow gold that had always seemed so clever and clear.
Left by BGG on 11/19/2008 6:11 AM
# re: How to get the current user logged into Sharepoint
Gravatar 完全無料セフレのミルク<br />安心確実!出会いのミルフィーユ
Left by 出会い系サイト on 3/4/2009 2:58 AM
# wow gold
Gravatar buy wow gold,cheap wow gold,wow power leveling.
Left by wowgold on 3/27/2009 9:18 PM
# wow gold
Gravatar Our selection ofwow gold bean bags
Left by zhuqian on 4/15/2009 10:45 PM
# re: How to get the current user logged into Sharepoint
Gravatar Thanks for the useful information, I really like it and think it’s a good topic. So would you interest at the news about the3D laser 3D camera
Left by laser crystal on 7/14/2009 10:25 PM
# re: How to get the current user logged into Sharepoint
Gravatar Thanks for the useful information, I really like it and think it’s a good topic.
Left by buy darkfall gold on 7/17/2009 3:34 AM
# cheap wow gold
Gravatar http://www.wowgolds.org have 3 years sales experience in world of warcraft. We are committed to provide users with fast, safe and cheap wow gold,wow accounts and powerleveling services!"
Left by aumid on 7/20/2009 3:41 AM
# re: How to get the current user logged into Sharepoint
Gravatar http://www.accountmmo.com is the best way to buy runescape accounts or sell runescape accounts. There are also hundreds wow accounts for sale. Update wow accounts everyday.100% safe guaranteed for buy wow account or sell wow accounts.
Left by runescape accounts for sale on 7/22/2009 3:21 AM
# jiljim
Gravatar Thanks for your comment, this is my new blog and I'll change the style for you my dear reader anytime! Really a good sharing.
Left by free online games on 7/28/2009 6:47 AM
# re: How to get the current user logged into Sharepoint
Left by 艶色熟女 on 8/3/2009 9:31 AM
# re: How to get the current user logged into Sharepoint
Gravatar great post
Left by vigrx plus on 8/11/2009 3:14 PM
# re: How to get the current user logged into Sharepoint
Gravatar Thanks for sharing this information. I found it very informative as I have been researching a lot lately on practical matters such as you talk about...and do not forget:
Say No to anyone who wants to buy steroids online.
Left by steroids on 8/14/2009 10:40 PM
# re: How to get the current user logged into Sharepoint
Gravatar Thanks for the post!
Left by Raghavendra on 8/25/2009 5:11 AM
# re: How to get the current user logged into Sharepoint
Gravatar
Thank you for this information. I found it very informative, as I have researched a lot lately about practical issues, as you speak.
Left by aion kinah on 9/9/2009 8:56 PM
# re: How to get the current user logged into Sharepoint
Gravatar why say no???
Left by Farouk on 9/10/2009 6:07 PM
# re: How to get the current user logged into Sharepoint
Gravatar Du ska får din visning av utan ordstäv en uttrycka, flaunt precis din replica Breitling klocka för den mycket egna kopian, och den ska takeomsorg av allt. Wtedy ty zdecydowanie lubić nasz bardzo replika breitling, robić wygląd i odczucie jak the autentyczny jeden.
Left by girlteam on 9/13/2009 3:08 AM
# Re: Día Mundial de Internet
Gravatar Försök vår breitling samling för kopian, det är den lika köpandet din mycket egna original- breitling klocka mindre än halva prissätta. Är du en av det fåtal som är hårda samlarear för matris av klockor?My oferować ty nasz replika fake breitling produkt, che zdecydowanie satysfakcjonować twój hobby gdy ono blisko spojrzenie i mieć prawie the ten sam ilość który the autentyczny jeden tylko przy niski koszt.
Left by girlteam on 9/15/2009 3:26 AM
# re: How to get the current user logged into Sharepoint
Gravatar Thank you for this information. This could be a useful info for those who use Sharepoint.
dirt bike games
Left by 1000 games on 9/15/2009 10:42 AM
# re: How to get the current user logged into Sharepoint
Gravatar This is great. Very useful for Sharepoint.
Left by Acai Berry on 9/16/2009 6:30 PM
# re: How to get the current user logged into Sharepoint
Gravatar Hi,
How can achieve this from an application that is not deployed on Sharepoint server but is linked (hyperlink) to a Sharepoint portal.

I need the current logged in username from a sharepoint portal to be passed to ASPx .Net application which resides on a non-Sharepoint server. To elaborate, the .Net application is deployed on Windows 2003 non-sharepoint server. The URL of this application is provided as hyperlink on a sharepoint site for end user accessibility.

I need the currently logged in sharepoint user id and sharepoint URL or actually the user email id, to be passed to the .Net application (maybe as query string or something). The user email id is required so that the application could send out a mail notification when it finishes the job. Is there anyway I can get the mail id in the application?

Thanks in advance.


Left by Kalpana on 9/17/2009 9:13 AM
# re: How to get the current user logged into Sharepoint
Gravatar Great post, thanks for the how to.
Left by online games on 9/18/2009 3:54 AM
# watch
Gravatar Progettare determinate feste di sogno fantastiche e goderlo giro indimenticabile in Tailandia. La Tha�lande est l'un de ces pays qui ont l'excellente beaut� normale avec le syst�me de gestion appropri�. The new <a href="http://http://www.kentuckymediaguid
Left by girlteam on 9/19/2009 2:48 AM
# re: How to get the current user logged into Sharepoint
Gravatar Diese Thailand-Pakete bietet Ihnen die w�hlenprogramme zwischen 3-7 Tagen oder sogar mehr an. Wenn Sie den Wunsch haben, die Welt zu sehen, phuket package ist dieses vermutlich die beste Zeit zu tun.
Left by girlteam on 9/19/2009 7:28 AM
# re: How to get the current user logged into Sharepoint
Gravatar Aion kina AION2009 year in September the latest high-speed Download,AION2009 year in September the latest careers information
Left by Aion kina on 9/22/2009 3:46 AM
# re: How to get the current user logged into Sharepoint
Gravatar metin2 yang
AION2009 year in September the latest high-speed Download,AION2009 year in September the latest careers information
Left by metin2 yang on 9/22/2009 3:48 AM
# re: How to get the current user logged into Sharepoint
Gravatar dofus kamas AION2009 year in September the latest high-speed Download,AION2009 year in September the latest careers information
Left by dofus kamas on 9/22/2009 3:49 AM
# re: How to get the current user logged into Sharepoint
Gravatar Good code, it helped me a lot
Left by Acer Laptops on 9/23/2009 8:26 AM
# Jewellery
Gravatar The new links management et votre présence régulière feront une plate-forme parfaite pour vos affaires et vous pouvez penser à quelques plus grandes occasions avec la même chose.
Left by George Matthews on 9/26/2009 6:25 PM
# re: How to get the current user logged into Sharepoint
Gravatar following snippet get the current user lgged into Sharepoint and displays his/her Name, Login name, Email and all the groups he/she belongs to the user defined code...
Left by Free online games on 9/29/2009 6:33 AM
# Mr
Gravatar The new add link es la idea perfecta para la gente que está comenzando su negocio en línea por el primer tiempo.
Left by George Matthews on 9/29/2009 12:49 PM
# re: How to get the current user logged into Sharepoint
Gravatar that for sharing this code. gonna try on sharepoint. resveratrol reviews
Left by hawth on 9/30/2009 2:35 PM
# re: How to get the current user logged into Sharepoint
Gravatar Nice !!!!!!!!

get sharepoint user and group, it is simple.

Try this too,
Get Current SharePoint user
Left by sara on 10/1/2009 11:43 PM
# re: How to get the current user logged into Sharepoint
Gravatar Ein Schweizer, der Rolex gebildet wird, ist eine Traumuhr für viele Männer und Frauen, aber das Erschwinglichkeit mater benennt in, wenn das Kaufen dieses exklusive Stück der Uhr aber jetzt sie herauf ihren Durst sich treffen kann, indem es eine Replik fake rolex kauft.
Left by girlteam on 10/3/2009 1:34 PM
# re: How to get the current user logged into Sharepoint
Gravatar This is very helpful, thanks a bunch.

adult site reviews
Left by Twistys on 10/3/2009 7:06 PM
# re: How to get the current user logged into Sharepoint
Gravatar great article. it really was insightful vigrx plus
Left by asdfasdf@yahoo.com on 10/5/2009 3:47 PM
# re: How to get the current user logged into Sharepoint
Gravatar I've been looking for this code all morning for Sharepoint... thank you very much.
Left by Respectable Reviews on 10/14/2009 11:43 AM
# re: How to get the current user logged into Sharepoint
Gravatar Hi,
How can achieve this from an application that is not deployed on Sharepoint server but is linked (hyperlink) to a Sharepoint portal. graduate diploma AND Online degrees
Left by markweee on 10/19/2009 1:48 AM
# re: How to get the current user logged into Sharepoint
Gravatar Heh very Coooollllllllllll!!!!!!!!!
Left by free online games on 10/19/2009 10:19 AM
# re: How to get the current user logged into Sharepoint
Gravatar that's really great, thanks!
Left by Math Heomework on 10/20/2009 7:55 AM
# weight loss links
Gravatar This will help no end, thanks.
Left by best slimming pills on 10/20/2009 11:06 AM
# re: How to get the current user logged into Sharepoint
Gravatar Nice post. i have been searching for this snippet from long time.Finally i got it.Thanks for sharing it.
Left by Bronchitis on 10/22/2009 1:47 AM
# re: How to get the current user logged into Sharepoint
Gravatar Excellent post thank you very much for taking the time to share with those who are starting on the subject. Greetings
Left by pariuri on 10/23/2009 3:27 AM
# re: How to get the current user logged into Sharepoint
Gravatar Well, this is a very valuable post. Thanks for the information you provided. It would be great if got more post like this. I appreciate it.
Left by clasamente fotbal on 10/23/2009 7:24 AM
# Get the current user logged into Sharepoint
Gravatar This is the clean piece of code snippet if was looking for. Now I can sit and go do it on my computer.
Left by Pruri Irurp on 10/24/2009 9:43 AM
# re: How to get the current user logged into Sharepoint
Gravatar Thats great! thanks for sharing
Left by Resveratrol Extract on 10/26/2009 6:04 AM
# re: How to get the current user logged into Sharepoint
Gravatar Thanks for the information you provided. It would be great if got more post like this.
Left by Home Teeth Whitening on 10/26/2009 6:05 AM
# re: How to get the current user logged into Sharepoint
Gravatar It would be great if got more post like this. I appreciate it.
Left by Colon Cleansing on 10/26/2009 6:07 AM
# re: How to get the current user logged into Sharepoint
Gravatar Wonderful article, thanks for putting this together! This is obviously one great post. Thanks for the valuable information and insights you have so provided here
Left by web chat software on 10/29/2009 7:07 AM
# re: How to get the current user logged into Sharepoint
Gravatar Yap "following snippet get the current user lgged into Sharepoint and displays his/her Name, Login name, Email and all the groups he/she belongs to the user defined code..."
Left by free games on 10/30/2009 12:02 PM
# re: How to get the current user logged into Sharepoint
Gravatar Wonderful article,thanks for putting this together! "This is obviously one great post. Thanks for the valuable information and insights you have so provided here. Keep it up!
Left by Invicta Watches on 11/2/2009 7:15 PM
# re: How to get the current user logged into Sharepoint
Gravatar Never knew that. Thanks for the info. I think your blog is going to
do well. People will always return to read this kind of content.Great job.
Left by wedding invitations on 11/4/2009 5:31 AM
# re: How to get the current user logged into Sharepoint
Gravatar very nice post.
too useful to me.
thanks.
Left by dofus kama on 11/5/2009 2:14 AM
# re: How to get the current user logged into Sharepoint
Gravatar Thanks for providing valuable information on the topic. Keep posting
Left by chat online on 11/10/2009 5:59 AM
# re: How to get the current user logged into Sharepoint
Gravatar Yap Thanks for your comment, this is my new blog and I'll change the style for you my dear reader anytime! Really a good sharing
Left by Free online games on 11/11/2009 9:31 AM
# re: How to get the current user logged into Sharepoint
Gravatar the following snippet get the current user lgged into Sharepoint and displays his/her Name, Login name
Left by street lights on 11/12/2009 2:24 AM
# re: How to get the current user logged into Sharepoint
Gravatar Email and all the groups he/she belongs to.
Left by christian louboutin on 11/12/2009 11:38 PM
# re: How to get the current user logged into Sharepoint
Gravatar the code in Module.vb
Left by christian louboutin sale on 11/16/2009 1:33 AM
# re: How to get the current user logged into Sharepoint
Gravatar This was a really good read for me, Must admit that you are one of the best bloggers I ever read.Thanks for posting this informative article and you can be sure I will be following up with coming articles.
Left by Reverse on 11/17/2009 10:03 AM
# re: How to get the current user logged into Sharepoint
Gravatar I loved the editorial. It is very interesting. Thank you for the information. faxless payday loans I will be back.
Left by payday loans in canada on 11/18/2009 1:39 PM

Leave Your Comment

Title*
Name*
Email (never displayed)
 (will show your gravatar)
Url
Comment*

 

Preview Your Comment.