当前位置:   article > 正文

window server 2022 AD域控如何使用命令或脚本批量导入&导出&创建用户及绑定安全组?(下)_windows ad防火墙组策略可疑导入导出吗

windows ad防火墙组策略可疑导入导出吗

内容介绍:

本文为AD域控用户管理高级篇,主要讲解如何使用命令批量创建新用户及安全组并绑定相应安全组,批量导入导出用户信息,查询用户、安全组、组织单位详细信息等内容,适用于域内用户较多的场景。

1 、显示用户所有属性信息

  1. PS C:\Users\Administrator>get-aduser -identity zhangs -Properties * (powershell执行)
  2. -identity 使用SamAccountName (用户登录名,如lis)

2 、批量导出域内用户到.csv文件中 

  1. 打开域控powershell,执行以下命令:
  2. 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=公司

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/905732
推荐阅读
相关标签
  

闽ICP备14008679号