ASP.NET获取数据AD有关用户 [英] ASP.NET Get data from AD about user

查看:141
本文介绍了ASP.NET获取数据AD有关用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要识别用户的内部网站,Windows用户名是我们的目标。这将被追加到PARAMS将SQL Server中的终点。

Need to identify user on intranet site, windows user name is the goal. That will be appended to params going to SQL Server in the end.

我能获得 HttpContext.Current.Request.ServerVariables(LOCAL_ADDR)192.168.112.81

我们有一个鱼龙混杂的地址在这里,在这33%是固定的,其余的分配。

We have a mixed bag of addresses here, in that 33% are fixed and the rest are allocated.

有没有追索权,以确定在AD分配到一个IP地址的用户?如果这样做,你有一个链接或一个例子?

Is there a recourse to identify the user assigned to an IP within AD? If so do you have a link or an example?

TIA。

推荐答案

在一个页面上,用户名可以与发现:

Within a page, the username can be found with:

Page.User.Identity.Name

HttpContext.Current.User.Identity.Name

或服务呼叫

ServiceSecurityContext.Current.WindowsIdentity.Name

这将是由域pfixed $ P $。

It will be prefixed by the domain.

这篇关于ASP.NET获取数据AD有关用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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