<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: ASP.NET &#8211; Get User Name Under Windows Authentication</title>
	<atom:link href="http://www.whypad.com/posts/aspnet-get-user-name-under-windows-authentication/628/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.whypad.com/posts/aspnet-get-user-name-under-windows-authentication/628/</link>
	<description>Tips, tricks, and hacks for life and tech...</description>
	<lastBuildDate>Thu, 29 Jul 2010 21:42:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Seth</title>
		<link>http://www.whypad.com/posts/aspnet-get-user-name-under-windows-authentication/628/comment-page-1/#comment-3999</link>
		<dc:creator>Seth</dc:creator>
		<pubDate>Thu, 08 Apr 2010 19:07:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.whypad.com/?p=628#comment-3999</guid>
		<description>The only consistent solution was AD Guys as we use Form Authentication in our project and none of the others would pull the information but that one.  We have a need for a seperate part of our application to pull AD Information but sill need Forms Authentication for others and that solution was the only one that worked.

Thanks AD Guy.</description>
		<content:encoded><![CDATA[<p>The only consistent solution was AD Guys as we use Form Authentication in our project and none of the others would pull the information but that one.  We have a need for a seperate part of our application to pull AD Information but sill need Forms Authentication for others and that solution was the only one that worked.</p>
<p>Thanks AD Guy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chuck</title>
		<link>http://www.whypad.com/posts/aspnet-get-user-name-under-windows-authentication/628/comment-page-1/#comment-3602</link>
		<dc:creator>Chuck</dc:creator>
		<pubDate>Mon, 14 Dec 2009 21:05:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.whypad.com/?p=628#comment-3602</guid>
		<description>Even easier to get the AD user name

my.user.name</description>
		<content:encoded><![CDATA[<p>Even easier to get the AD user name</p>
<p>my.user.name</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Byron Bennett</title>
		<link>http://www.whypad.com/posts/aspnet-get-user-name-under-windows-authentication/628/comment-page-1/#comment-2866</link>
		<dc:creator>Byron Bennett</dc:creator>
		<pubDate>Thu, 09 Jul 2009 13:24:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.whypad.com/?p=628#comment-2866</guid>
		<description>@Thang, @AD Guy,

Thanks for the hints!
Byron</description>
		<content:encoded><![CDATA[<p>@Thang, @AD Guy,</p>
<p>Thanks for the hints!<br />
Byron</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AD Guy</title>
		<link>http://www.whypad.com/posts/aspnet-get-user-name-under-windows-authentication/628/comment-page-1/#comment-2864</link>
		<dc:creator>AD Guy</dc:creator>
		<pubDate>Thu, 09 Jul 2009 07:24:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.whypad.com/?p=628#comment-2864</guid>
		<description>DirectoryEntry dEntry = new DirectoryEntry(&quot;WinNT://&quot; + Environment.UserDomainName + &quot;/&quot; + Environment.UserName);            
return dEntry.Properties[&quot;fullName&quot;].Value.ToString();</description>
		<content:encoded><![CDATA[<p>DirectoryEntry dEntry = new DirectoryEntry(&#8220;WinNT://&#8221; + Environment.UserDomainName + &#8220;/&#8221; + Environment.UserName);<br />
return dEntry.Properties["fullName"].Value.ToString();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thang</title>
		<link>http://www.whypad.com/posts/aspnet-get-user-name-under-windows-authentication/628/comment-page-1/#comment-2802</link>
		<dc:creator>Thang</dc:creator>
		<pubDate>Fri, 03 Jul 2009 09:15:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.whypad.com/?p=628#comment-2802</guid>
		<description>Hi Brian,
You try with below code
string strAccount = HttpContext.Current.User.Identity.Name.ToString();
string strUserName = strAccount .Split(&quot;\\&quot;.ToCharArray())[1];

have fun coding,
BB</description>
		<content:encoded><![CDATA[<p>Hi Brian,<br />
You try with below code<br />
string strAccount = HttpContext.Current.User.Identity.Name.ToString();<br />
string strUserName = strAccount .Split(&#8220;\\&#8221;.ToCharArray())[1];</p>
<p>have fun coding,<br />
BB</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Byron Bennett</title>
		<link>http://www.whypad.com/posts/aspnet-get-user-name-under-windows-authentication/628/comment-page-1/#comment-2729</link>
		<dc:creator>Byron Bennett</dc:creator>
		<pubDate>Sun, 28 Jun 2009 06:20:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.whypad.com/?p=628#comment-2729</guid>
		<description>Brain,
I&#039;m not sure.  I was getting the domain name when I was using it since I was on a LAN with Active Directory running.  Since the domain was always the same for my app, I checked for it and replaced it.  Sorry I don&#039;t have the answer right now.

BB</description>
		<content:encoded><![CDATA[<p>Brain,<br />
I&#8217;m not sure.  I was getting the domain name when I was using it since I was on a LAN with Active Directory running.  Since the domain was always the same for my app, I checked for it and replaced it.  Sorry I don&#8217;t have the answer right now.</p>
<p>BB</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian</title>
		<link>http://www.whypad.com/posts/aspnet-get-user-name-under-windows-authentication/628/comment-page-1/#comment-2714</link>
		<dc:creator>Brian</dc:creator>
		<pubDate>Fri, 26 Jun 2009 18:18:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.whypad.com/?p=628#comment-2714</guid>
		<description>Thanks for the help above though

The above code returns the whole name including the computer name
eg
when i write those codes to my computer i gives me the following result

BROMPO-379477BA\Brian

But i just want to get Brian and not the whole string how will i do that???</description>
		<content:encoded><![CDATA[<p>Thanks for the help above though</p>
<p>The above code returns the whole name including the computer name<br />
eg<br />
when i write those codes to my computer i gives me the following result</p>
<p>BROMPO-379477BA\Brian</p>
<p>But i just want to get Brian and not the whole string how will i do that???</p>
]]></content:encoded>
	</item>
</channel>
</rss>
