How to obtain current user ID from AD?

G

Guest

Hey guys,

We have an intranet at the office. I typically do most of the forms in
Cold Fusion. With Cold Fusion I can easily define the #strUserID# as the AD
user value. I'm writing this new form in C# because it integrates better with
Microsoft CRM and for the life of me, I cannot remember how to get the name
of the user that's logged in.

It would look something like "tjaspers" for "Todd Jaspers".


Any ideas???



Thanks!!!

Todd
 
A

Aneesh Pulukkul[MCSD.Net]

Hey guys,

We have an intranet at the office. I typically do most of the forms in
Cold Fusion. With Cold Fusion I can easily define the #strUserID# as the AD
user value. I'm writing this new form in C# because it integrates better with
Microsoft CRM and for the life of me, I cannot remember how to get the name
of the user that's logged in.

It would look something like "tjaspers" for "Todd Jaspers".

Any ideas???

Thanks!!!

Todd

Seems you need the display name of user. Is that correct?
 
A

Aneesh Pulukkul[MCSD.Net]

Hey guys,

We have an intranet at the office. I typically do most of the forms in
Cold Fusion. With Cold Fusion I can easily define the #strUserID# as the AD
user value. I'm writing this new form in C# because it integrates better with
Microsoft CRM and for the life of me, I cannot remember how to get the name
of the user that's logged in.

It would look something like "tjaspers" for "Todd Jaspers".

Any ideas???

Thanks!!!

Todd

Can you make use of the code posted here:http://devauthority.com/blogs/
razor/archive/2005/06/30/112.aspx
 
G

Guest

Yes and no. I don't need the full name, I just need the user's ID. (which is
the ID he or she used to log in with).


Thanks!

Todd
 
N

Nicholas Paldino [.NET/C# MVP]

Todd,

Are you doing this in ASP.NET or not? I ask because you mentioned Cold
Fusion and I thought that was a web-based framework.

If you are NOT, then you can use the static UserDomainName property on
the Environment class.

If you are in ASP.NET, then you will have to make sure that windows
authentication is turned on for your site, and then you should be able to
get the name from the IIdentity information that is exposed through the User
property on the Page class.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top