【.Net】.Net操作AD域账号,获取AD用户后可以获取的属性列表 directoryEntry Properties list
前言
近期项目上通过.Net操作AD用户,获取AD用户后根据相关属性获取用户基本信息,如邮箱、显示名、电话等
DirectoryEntry Properties List
objectClass=top;person;organizationalPerson;user
cn=x1
sn=LastName
c=PL
l=City
st=State
title=Job title
description=Description
postalCode=Zip
postOfficeBox=POBox
physicalDeliveryOfficeName=Office
telephoneNumber=123456779
givenName=FirstName
distinguishedName=CN=x1,CN=Users,DC=helpdesk,DC=wat,DC=edu
instanceType=4
whenCreated=2012-11-27 21:37:37
whenChanged=2012-12-11 21:33:51
displayName=DisplayName
uSNCreated=System.__ComObject
uSNChanged=System.__ComObject
co=Poland
department=Department
company=Company
streetAddress=Street
name=x1
objectGUID=System.Byte[]
userAccountControl=66048
badPwdCount=0
codePage=0
countryCode=616
badPasswordTime=System.__ComObject
lastLogoff=System.__ComObject
lastLogon=System.__ComObject
pwdLastSet=System.__ComObject
primaryGroupID=513
objectSid=System.Byte[]
accountExpires=System.__ComObject
logonCount=1
sAMAccountName=x1
sAMAccountType=805306368
userPrincipalName=x1@helpdesk.wat.edu
objectCategory=CN=Person,CN=Schema,CN=Configuration,DC=helpdesk,DC=wat,DC=edu
dSCorePropagationData=1601-01-01 00:00:00
lastLogonTimestamp=System.__ComObject
mail=mail@mail.com
homePhone=1236456654654659
mobile=800800800
nTSecurityDescriptor=System.__ComObject
.Net获取属性代码
示例1:
DirectoryEntry deUser = new DirectoryEntry(path);foreach (var prop in deUser.Properties)
{//if user.Properties["company"] is not set on this user then //it will not be available here although 'company' is //a property defined for the user class
}//How do I get to the list of all available properties using
//deUserSchema as below
DirectoryEntry deUserSchema = deUser.SchemaEntry();示例2:
String myADSPath = "LDAP://onecity/CN=Users,DC=onecity,DC=corp,DC=fabrikam,DC=com";// Creates an Instance of DirectoryEntry.
DirectoryEntry myDirectoryEntry=new DirectoryEntry(myADSPath, UserName, SecurelyStoredPassword);// Gets the SchemaEntry of the ADS object.
DirectoryEntry mySchemaEntry = myDirectoryEntry.SchemaEntry;if (string.Compare(mySchemaEntry.Name,"container") == 0)
{foreach(DirectoryEntry myChildDirectoryEntry in myDirectoryEntry.Children){//...do what you need}
}
【.Net】.Net操作AD域账号,获取AD用户后可以获取的属性列表 directoryEntry Properties list相关推荐
- 如何查看AD域账号的删除记录
**如何查看AD域账号删除记录及恢复** 在日常AD域管理中,有时候我们不小心删除了域账号,或者我们想查看这个域账号是什么时候创建并删除的,那怎么办?是否可以恢复?其实微软本身已经为我们的账号信息做了 ...
- 华润大学ldap账号是什么_认证配置 - 接入 LDAP / AD 域账号(Beta) - 《KubeSphere v2.1 使用手册》 - 书栈网 · BookStack...
接入 LDAP / AD 域账号(Beta) 如果您的企业使用 LDAP 作为用户认证系统,您可以在 KubeSphere 中通过脚本配置内置的 OpenLDAP 接入您的 LDAP 用户系统,从而允 ...
- 无影云电脑居家办公最佳实践(AD域账号)
简介:2020年初新冠肺炎疫情在全球迅速蔓延,突如其来的疫情让大多数企业不得不停工停产,企业在探索和实践各种新的办公方式,远程办公.居家办公的需求和市场规模呈现出爆发式增长,已成为企业的共识和全球趋势 ...
- libnss mysql_Ubuntu通过LDAP集成AD域账号登录(libnss-ldap方式)
Ubuntu通过LDAP集成AD域账号登录(libnss-ldap方式): # apt-get install libnss-ldap (中间直接回车,忽略) # vi /etc/nsswitch ...
- linux nslcd服务,CentOS 6通过ldap集成AD域账号(nslcd方式)
CentOS 6通过ldap集成AD域账号(nslcd方式): yum install nss-pam-ldapd(rpm -qa nss-pam-ldapd,rpm -ql nss-pam-ldap ...
- AD域账号日常维护常用操作
查询指定OU中30天内未登录的AD帐号并导出记录 Get-ADuser -searchbase ' OU=MIS,DC=NDH,DC=com ' -filter * -Properties * | S ...
- 使用Novell.Directory.Ldap.NETStandard在.NET Core中验证AD域账号
Novell.Directory.Ldap.NETStandard是一个在.NET Core中,既支持Windows平台,又支持Linux平台,进行Windows AD域操作的Nuget包. 首先我们 ...
- 网站识别Windows AD 域账号,并自动登录
KDC (windows 2008): 10.0.2.12 (也就是域服务器) Workstation (windows 10): 10.0.2.100(也就是公司域内电脑) Webserver (C ...
- AD 域服务简介(二)- Java 获取 AD 域用户
博客地址:http://www.moonxy.com 关于AD 域服务器搭建及其使用,请参阅:AD 域服务简介(一) - 基于 LDAP 的 AD 域服务器搭建及其使用 一.前言 先简单简单回顾上一篇 ...
- IP-GUARD如何同步AD域账号(导入AD域功能使用说明)
导入AD域功能使用说明 若您的局域网中存在AD域组织结构,那么,通过AD域导入功能,您可以为AD域中未接入服务器的计算机和用户预先配置分组,当客户端接入服务器后,可自动分配到其所属分组中. 登陆AD域 ...
最新文章
- libev源码解析——总览
- 20162329 2017-2018-1 《程序设计与数据结构》第九周学习总结
- LeetCode-链表-24. 两两交换链表中的节点
- kettle的安装与连接mysql(包含mysql8)简单使用,
- Chomp!博弈(巧克力游戏)
- RC隔离级别下的GAP间隙锁
- poj3723Conscription
- 教之初计算机考试函数应用题,教之初计算机考试系统
- ANSI/UTF-8/UCS2(UTF-16),以及回车换行
- c语言 __FILE__,__DATE__,__TIME__ (宏)
- js中字符串类转为日期类,并比较
- 温州大学c语言作业布置的网站,2016年温州大学物理与电子信息工程学院综合卷之C语言程序设计复试笔试仿真模拟题...
- 高中数学解析几何解题方法,2019高考生没有掌握方法!
- 阿里云的“飞天“是什么?
- Git生成SSH Key
- 十大管理之项目干系人管理知识点
- 单片机编程之8421码
- 通灵学院|游戏设计研习1:人类的需求与动机★(1200字)
- 图像处理直方图均衡化
- 使用endnote在毕业论文中插入文献