谁从Active Dir登录用户? [英] who is logged in user, from Active Dir?

查看:71
本文介绍了谁从Active Dir登录用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在计算机上获取当前登录用户?我们都活跃了

这里的目录 - 然而Netbios没有打开。当他启动他的机器时,我需要得到用户登录的名字

...


TY

jason shohet

解决方案

Jason Shohet写道:

如何在计算机上获取当前登录用户?我们都是这里的Active Directory - 然而Netbios没有打开。我需要
获取用户登录的名称,当他启动他的机器时......




Jason,
如果您的IIS应用程序正在使用Windows身份验证,并且您已在web.config中启用了身份模拟,那么您可以获得当前

用户的凭证使用:WindowsIdentity.GetCurrent()。名称


-


谢谢,

Carl Prothman

微软ASP.NET MVP


聘请顶尖开发人员 http://www.able-consulting.com


hi Carl,

我们没有在网站上使用任何身份验证 - 它只是一个常规的asp.net

内部网站点,显示了员工列表。我们想让员工

来编辑数据库中的一些记录。但首先我们必须知道他们是谁?
登录为盒子。但我不想让用户必须在网站上记录

...如果我在iis中启用Windows身份验证(Windows 2003

服务器) ,这会导致一个丑陋的挑战 - 反应窗口吗?


TY


" Carl Prothman [MVP]" < CA **** @ spamcop.net>在消息中写道

news:u0 ************** @ TK2MSFTNGP14.phx.gbl ...

Jason Shohet写道:< blockquote class =post_quotes>如何在计算机上获取当前登录用户?我们都是这里的Active Directory - 然而Netbios没有打开。我需要
来获取用户登录的名称,当他启动他的
机器时......



Jason,
如果你的IIS应用程序正在使用Windows身份验证,您在web.config中启用了身份模拟,然后您可以使用以下命令获取当前
用户的凭据:WindowsIdentity.GetCurrent()。名称

-

谢谢,
Carl Prothman
Microsoft ASP.NET MVP

聘请顶尖开发人员来自
=nofollowhref =http://www.able-consulting.comtarget =_ blank> http://www.able-consulting.com



如果使用IE,则不会。 (Firefox仍会提示)。我们一直使用它

(Windows 2000 Server IIS 5)


取消选中匿名,并检查集成


添加< authentication mode =" Windows" />到web.config也


你不需要在web.config中启用Identity Impersonate来获取

用户名!


Dim sCurrentuser As String = HttpContext.Current.User.Identity.Name将从一个类

或者简单地从Page.User.Identity.Name获取
一个网络表格。


格雷格


Jason Shohet < __ ****** @ yahoo.com>在消息中写道

新闻:OQ ************* @ TK2MSFTNGP11.phx.gbl ...

嗨Carl,我们没有在网站上使用任何身份验证 - 它只是一个常规的
asp.net内部网站点,显示了员工列表。我们想让
员工编辑数据库中的一些记录。但首先我们必须知道他们登录的人是谁。但我不想让
用户登录到网站...如果我在
iis(Windows 2003服务器)中启用Windows身份验证,那将导致一个丑陋的挑战 - 回复
窗口?

Carl Prothman [MVP]" < CA **** @ spamcop.net>在消息中写道
新闻:u0 ************** @ TK2MSFTNGP14.phx.gbl ...

Jason Shohet写道:

如何在计算机上获取当前登录用户?我们都是这里的Active Directory - 然而Netbios没有打开。我需要
来获取用户登录的名称,当他启动他的
机器时......



Jason,
如果你的IIS应用程序正在使用Windows身份验证,您在web.config中启用了身份模拟,然后您可以使用以下命令获取当前
用户的凭据:WindowsIdentity.GetCurrent()。名称

-

谢谢,
Carl Prothman
Microsoft ASP.NET MVP

聘请顶尖开发人员来自
=nofollowhref =http://www.able-consulting.comtarget =_ blank> http://www.able-consulting.com




How can I get the current logged in user on the computer? We''re all Active
Directory here -- Netbios is not turned on however. I need to get the name
the user logged in as, when he started up his machine...

TY
jason shohet

解决方案

Jason Shohet wrote:

How can I get the current logged in user on the computer? We''re all
Active Directory here -- Netbios is not turned on however. I need
to get the name the user logged in as, when he started up his
machine...



Jason,
If your IIS Application is using Windows Authentication and you have
Identity Impersonate enabled in web.config, then you can get the current
user''s credential using: WindowsIdentity.GetCurrent().Name

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP

Hire top-notch developers at
http://www.able-consulting.com


hi Carl,
we''re not using any authentication on the site -- its just a regular asp.net
intranet site that shows a list of employees. We''d like to allow employees
to edit a few records in a database. But first we have to know who they are
logged in as -- on the box. But I don''t want to have the user have to log
in to the site... If i turn on windows authentication in iis (windows 2003
server), will that cause an ugly challenge-response window?

TY

"Carl Prothman [MVP]" <ca****@spamcop.net> wrote in message
news:u0**************@TK2MSFTNGP14.phx.gbl...

Jason Shohet wrote:

How can I get the current logged in user on the computer? We''re all
Active Directory here -- Netbios is not turned on however. I need
to get the name the user logged in as, when he started up his
machine...



Jason,
If your IIS Application is using Windows Authentication and you have
Identity Impersonate enabled in web.config, then you can get the current
user''s credential using: WindowsIdentity.GetCurrent().Name

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP

Hire top-notch developers at
http://www.able-consulting.com



Not if using IE. (Firefox will still prompt). We use it all the time
(Windows 2000 Server IIS 5)

uncheck anonymous, and check integrated

add <authentication mode="Windows" /> to web.config also

you do NOT need to turn on Identity Impersonate in web.config to get
username!

Dim sCurrentuser As String = HttpContext.Current.User.Identity.Name will do
it from a class
or simply Page.User.Identity.Name from a web form.

Greg

"Jason Shohet" <__******@yahoo.com> wrote in message
news:OQ*************@TK2MSFTNGP11.phx.gbl...

hi Carl,
we''re not using any authentication on the site -- its just a regular
asp.net intranet site that shows a list of employees. We''d like to allow
employees to edit a few records in a database. But first we have to know
who they are logged in as -- on the box. But I don''t want to have the
user have to log in to the site... If i turn on windows authentication in
iis (windows 2003 server), will that cause an ugly challenge-response
window?

TY

"Carl Prothman [MVP]" <ca****@spamcop.net> wrote in message
news:u0**************@TK2MSFTNGP14.phx.gbl...

Jason Shohet wrote:

How can I get the current logged in user on the computer? We''re all
Active Directory here -- Netbios is not turned on however. I need
to get the name the user logged in as, when he started up his
machine...



Jason,
If your IIS Application is using Windows Authentication and you have
Identity Impersonate enabled in web.config, then you can get the current
user''s credential using: WindowsIdentity.GetCurrent().Name

--

Thanks,
Carl Prothman
Microsoft ASP.NET MVP

Hire top-notch developers at
http://www.able-consulting.com




这篇关于谁从Active Dir登录用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆