473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to obtain current user ID from AD?

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
Jun 8 '07 #1
4 4266
On Jun 8, 11:04 pm, Todd Jaspers
<ToddJasp...@discussions.microsoft.comwrote:
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?

Jun 8 '07 #2
On Jun 8, 11:04 pm, Todd Jaspers
<ToddJasp...@discussions.microsoft.comwrote:
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

Jun 8 '07 #3
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

"Aneesh Pulukkul[MCSD.Net]" wrote:
On Jun 8, 11:04 pm, Todd Jaspers
<ToddJasp...@discussions.microsoft.comwrote:
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?

Jun 8 '07 #4
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.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Todd Jaspers" <To*********@discussions.microsoft.comwrote in message
news:14**********************************@microsof t.com...
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

Jun 8 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: new pip | last post by:
I'm using Windows os. If the current system date time is '28 Jun 2001 14:17:15 +0700', how can I obtain the value '+0700' using python? Thank you
15
by: SFX | last post by:
If I have a session ID (string) can I somehow obtain the session object associated to that ID (it exist of course) ? I know this sounds wicked but I have a situation in which I have to make a...
3
by: cmrchs | last post by:
Hi, I try to obtain the current culture of a server by executing : string str = Thread.CurrentThread.CurrentCulture.ToString(); Executing this in a console-applicastion results in the...
2
by: **Developer** | last post by:
THIS IS WHAT I DO: Dim lG As Graphics = pD.PrinterSettings.CreateMeasurementGraphics() Dim lHdc As IntPtr = lG.GetHdc() leftOffsetP = GetDeviceCaps(lHdc, PHYSICALOFFSETX) topOffsetP =...
1
by: VictorG | last post by:
Hello, The below C# code works fine in obtaining the windows user's account SID when the user is local to the machine. It throws a "Not Found" exception when trying top obtain the SID for a...
11
by: Jacek Dziedzic | last post by:
Hi! I need a routine like: std::string nth_word(const std::string &s, unsigned int n) { // return n-th word from the string, n is 0-based // if 's' contains too few words, return "" //...
2
by: ME | last post by:
How would one obtain the parameter VALUES of a method that has already run? I can find the method using the StackTrace and StackFrame classes but once I find the method I would like to obtain the...
2
by: mm3178 | last post by:
Hello Mates, My case is slightly complicated....please help me In order to obtain real time current balance of an account, I have built a c# windows service that invokes a c# web service...
0
by: leonardo.schmidt | last post by:
Due to some connectivity problems with a client's VPN software, I'm developing an app that needs to obtain the current logged user's Exchange server address & add a new route (among other...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.