asp.net – 如何提取与Outlook正在显示的employeeID属性值相同?
由于各种原因,我们公司使用ActiveDirectory.其中一个是处理Outlook联系人和用户登录ID.
我写了一个程序来检测登录的用户标识,并使用提取的登录ID搜索Active Directory.然后将来自Active Directory的拉出的信息存储在数据库中. 以下是我用于拉取ActiveDirectory信息数据的代码: Dim enTry As DirectoryEntry = _ New DirectoryEntry("LDAP://myCOMPANY/DC=myCOMPANY,DC=myCOMPANY,DC=com") Dim mySearcher As DirectorySearcher = New DirectorySearcher(enTry) mySearcher.Filter = "(&(objectClass=user)(anr=" & thisUser & "))" 'thisUser is the variable holding the Windows ID that is accessing the ASPX page mySearcher.PropertiesToLoad.Add("employeeID") 'just in case I need to do this. Dim resEnt As SearchResult Try For Each resEnt In mySearcher.FindAll() Dim fullname As String = resEnt.GetDirectoryEntry.Properties.Item("cn").Value 'fullname will always pull the right information Dim e_id As String = resEnt.GetDirectoryEntry.Properties.Item("employeeID").Value 'e_id will sometimes be NOTHING,sometimes will contain an ID that ' is different from the one displayed in Outlook Contact Information ' and sometimes it will be matching the employeeID listed in Outlook info Catch ex as Exception Log("Failed to pull AD data: " & ex.Message) End Try 由于某些原因,一些用户对于employeeID字段没有任何值,有些用户没有. 但是,在Outlook中浏览时,所有用户都将显示employeeID值. 我设计了以下图像来帮助您了解我正在经历的事情. ================================================== ====== 在案例1中,员工已使用他的ID:xms33808登录到Windows Outlook显示他的员工ID为16078 Outlook显示他的电子邮件别名是xms33808 ASP.Net命令窗口显示他的employeeID是xms33808,这不是真的 ================================================== ==== ================================================== ===== 在情况2中,员工已使用ID:25163登录Windows Outlook显示他的员工ID为25163 Outlook显示他的电子邮件别名是MutawaAAB ASP.Net命令窗口显示他的employeeID是NOTHING. ================================================== ===== 我的问题是:如何解压缩Outlook显示的相同的employeeID值信息? 解决方法
有一个令人困惑的AD属性叫做“employeeNumber”.可能是Outlook实际上正在使用此属性来填充它的显示?
根据Outlook Contact Cards上的此Microsoft支持页面,“employeeID”不是您可以使用的字段.但是,’employeeNumber’是. http://support.microsoft.com/kb/981022 希望这有助于至少提高您的故障排除工作. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- asp.net-mvc – 如何覆盖ASP.Net MVC的默认模型绑定器,以便
- 为什么ASP.NET自动生成的.designer代码的类型不正确?
- asp.net – 通过ASP .Net成员身份进行用户登录
- .net – Razor RTM中的声明性助手方法
- asp.net-core – 如何从控制器中解析ASP NET 5中的EF7当前数
- asp.net – 上下文菜单没有“添加脚手架”或“添加控制器”
- ASP.net会员强制用户离线(作为管理员)
- 模型视图控制器 – 如何在自定义MembershipProvider上调用I
- asp.net-mvc – 用于KendoUI AutoComplete的开箱即用的MVC
- asp.net-mvc – 405消息,Web Api不允许的方法
- asp.net-core – 如何在ASP.NET Core 2.0中实现m
- asp.net – 将页脚粘贴到页面底部的方法
- 基于ASP.Net Core开发的一套通用后台框架
- asp.net-mvc-4 – MVC 4捆绑URL而不是文件
- 如何在ASP.NET中的GridView中定义CellPadding
- asp.net-mvc – ASP.net MVC返回文件和重定向
- nuget-package – 如何在asp.net 5应用程序中添加
- 用于高级搜索/过滤的.Net WebAPI URI约定
- asp.net mvc webapi 实用的接口加密方法
- asp.net – c#如何获取httpResponse.BinaryWrite