How to obtain current user ID from AD?

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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?
 
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
 
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
 
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.
 
Back
Top