赞
踩
本文为AD域控用户管理高级篇,主要讲解如何使用命令,批量创建新用户及安全组并绑定相应安全组,批量导入导出用户信息,查询用户、安全组、组织单位详细信息等内容,适用于域内用户较多的场景。
- PS C:\Users\Administrator>get-aduser -identity zhangs -Properties * (powershell执行)
-
- -identity 使用SamAccountName (用户登录名,如lis)
- 打开域控powershell,执行以下命令:
- PS C:\Users\Administrator> Get-ADUser -Filter * -Properties * -SearchBase "OU=中车集团,DC=adsrvtest01,DC=com" | select SamAccountName, name, displayname, Givenname, Surname,DistinguishedName, Department, UserPrincipalName, City, Office, StreetAddress, State, Title, Company, OfficePhone, HomePhone, MobilePhone, emailaddress, Enabled | export-csv -path c:\export-ou.csv -Encoding Unicode -NoTypeInformation (其中写用户组织单位,DC为域名前缀)
导出的csv文件内容如下
SamAccountName,"name","displayname","Givenname","Surname","DistinguishedName","Department","UserPrincipalName","City","Office","StreetAddress","State","Title","Company","OfficePhone","HomePhone","MobilePhone","emailaddress","Enabled" |
zhangs,"张三zhangs","张三zhangs","三","张","CN=张三zhangs,OU=运维管理部,OU=公司 |
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。