内容介绍:
本文为AD域控用户管理高级篇,主要讲解如何使用命令,批量创建新用户及安全组并绑定相应安全组,批量导入导出用户信息,查询用户、安全组、组织单位详细信息等内容,适用于域内用户较多的场景。
1 、显示用户所有属性信息
PS C:\Users\Administrator>get-aduser -identity zhangs -Properties * (powershell执行)
-identity 使用SamAccountName (用户登录名,如lis)
2 、批量导出域内用户到.csv文件中
打开域控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=公司
版权归原作者 技术瘾君子1573 所有, 如有侵权,请联系我们删除。