对于开发的同学一般都知道,对于某个服务的操作,需要对对应的服务属性做了解才可以开发出相关的东西,今天我们主要介绍的是LDAP的相关属性,所有的管理员都知道,自动化都可以协助自身提高工作效率,不管是通过powershell、vbs、bat还是其他的java等开发语言,都需要对对应的服务属性做调用或者获取、修改等操作,我们最常见的是对LDAP做管理操作,今天我们主要介绍一下LDAP用户属性的配置介绍。

我们首先说说上篇文章中提到如何禁用MSAD用户,其实很简单,我们需要修改用户的useraccountcontrol属性,这个属性对用户的很多功能做完全控制,比如要禁用用户,我们需要将用户的useracountcontrol属性值修改为514即可。

我们创建的正常用户属性为512,改用户没有任何属性配置

p_w_picpath

没有任何属性控制

p_w_picpath

我们可以根据以下信息来修改用户属性

512 Enabled            
514 ACCOUNTDISABLE
528 Enabled - LOCKOUT
530 ACCOUNTDISABLE - LOCKOUT
544 Enabled - PASSWD_NOTREQD
546 ACCOUNTDISABLE - PASSWD_NOTREQD
560 Enabled - PASSWD_NOTREQD - LOCKOUT
640 Enabled - ENCRYPTED_TEXT_PWD_ALLOWED
2048 INTERDOMAIN_TRUST_ACCOUNT
2080 INTERDOMAIN_TRUST_ACCOUNT - PASSWD_NOTREQD
4096 WORKSTATION_TRUST_ACCOUNT
8192 SERVER_TRUST_ACCOUNT
66048 Enabled - DONT_EXPIRE_PASSWORD
66050 ACCOUNTDISABLE - DONT_EXPIRE_PASSWORD
66064 Enabled - DONT_EXPIRE_PASSWORD - LOCKOUT
66066 ACCOUNTDISABLE - DONT_EXPIRE_PASSWORD - LOCKOUT
66080 Enabled - DONT_EXPIRE_PASSWORD - PASSWD_NOTREQD
66082 ACCOUNTDISABLE - DONT_EXPIRE_PASSWORD - PASSWD_NOTREQD
66176 Enabled - DONT_EXPIRE_PASSWORD - ENCRYPTED_TEXT_PWD_ALLOWED
131584 Enabled - MNS_LOGON_ACCOUNT
131586 ACCOUNTDISABLE - MNS_LOGON_ACCOUNT
131600 Enabled - MNS_LOGON_ACCOUNT - LOCKOUT
197120 Enabled - MNS_LOGON_ACCOUNT - DONT_EXPIRE_PASSWORD
532480 SERVER_TRUST_ACCOUNT - TRUSTED_FOR_DELEGATION (Domain Controller)
1049088 Enabled - NOT_DELEGATED
1049090 ACCOUNTDISABLE - NOT_DELEGATED
2097664 Enabled - USE_DES_KEY_ONLY
2687488 Enabled - DONT_EXPIRE_PASSWORD - TRUSTED_FOR_DELEGATION - USE_DES_KEY_ONLY
4194816 Enabled - DONT_REQ_PREAUTH

以上是用户属性的useracountcontrol属性介绍,下面我们介绍用户的其他属性信息

“常规”标签

姓 Sn  
名 Givename  
英文缩写 Initials  
显示名称 displayName  
描述 Description  
办公室 physicalDeliveryOfficeName   
电话号码 telephoneNumber  
电话号码:其它 otherTelephone 多个以英文分号分隔  
电子邮件 Mail  
网页 wWWHomePage  
网页:其它 url 多个以英文分号分隔

“地址”标签

国家/地区 C 如:中国CN,英国GB  
省/自治区 St   
市/县 L  
街道 streetAddress  
邮政信箱 postOfficeBox  
邮政编码 postalCode
“帐户”标签
用户登录名 userPrincipalName 形如:zs@abc.com  
用户登录名(以前版本) sAMAccountName 形如:S1  
登录时间 logonHours   
登录到 userWorkstations 多个以英文逗号分隔  
用户帐户控制 userAccountControl (启用:512,禁用:514, 密码永不过期:66048)  
帐户过期 accountExpires

配置文件”标签

配置文件路径 profilePath  
登录脚本 scriptPath  
主文件夹:本地路径 homeDirectory  
连接 homeDrive  
到 homeDirectory

“电话”标签

家庭电话 homePhone (若是其它,在前面加other。)  
寻呼机 Pager 如:otherhomePhone。  
移动电话 mobile 若多个以英文分号分隔。  
传真 FacsimileTelephoneNumber   
IP电话 ipPhone  
注释 Info

“单位”标签

职务 Title  
部门 Department  
公司 Company

隶属于”标签

隶属于  memberOf  用户组的DN不需使用引号, 多个用分号分隔   
“拨入”标签 远程访问权限(拨入或×××) msNPAllowDialin  
允许访问 值:TRUE  
拒绝访问 值:FALSE  
回拨选项 msRADIUSServiceType  
由呼叫方设置或回拨到 值:4  
总是回拨到 msRADIUSCallbackNumber


显示名称

属性名称

First Name

givenName

Last Name

sn

Initials

initials

Description

description

Office

physicalDeliveryOfficeName

Telephone Number

telephoneNumber

Telephone: Other

otherTelephone

E-Mail

mail

Web Page

wwwHomePage

Web Page: Other

url


外型属性


显示名称

属性名称

Profile Path

profilePath

Logon Script

scriptPath

Home Folder: Local Path

homeDirectory

Home Folder: Connect

homeDrive

Home Folder: To

homeDirectory

电话相关属性


显示名称

属性名称

Home

telephoneNumber

Home: Other

otherTelephone

Pager

pager

Pager: Other

pagerOther

Mobile

mobile

Mobile: Other

otherMobile

Fax

facsimileTelephoneNumber

Fax: Other

otherFacsimileTelephoneNumber

IP phone

ipPhone

IP phone: Other

otherIpPhone

Notes

info

帐号属性:


显示名称

属性名称

UserLogon Name

userPrincipalName

User logon name (pre-Windows 2000)

sAMAccountname

Logon Hours

logonHours

Log On To

logonWorkstation

Account is locked out

userAccountControl

User must change password at next logon

pwdLastSet

User cannot change password

N/A

Other Account Options

userAccountControl

Account Expires

accountExpires

地址属性


显示名称

属性名称

Street

streetAddress

P.O.Box

postOfficeBox

City

l

State/Province

st

Zip/Postal Code

postalCode

Country/Region

c,co, and countryCode

组织属性


显示名称

属性名称

Title

title

Department

department

Company

company

Manager:Name

manager

Direct Reports

directReports