Windows Server 2016-Powershell新建用户补充

前边我们介绍到Windows Server 2016-图形化新建域用户(一)Windows Server 2016-批量新建域用户(二) ,里边提到了批量通过new-aduser常见帐号,这里简单的对前章节内容做个补充,具体信息如下:

命令语法:

New-ADUser [-Name] <string> [-AccountExpirationDate <System.Nullable[System.DateTime]>] [-AccountNotDelegated <System.Nullable[bool]>] [-AccountPassword <SecureString>] [-AllowReversiblePasswordEncryption <System.Nullable[bool]>] [-AuthType {<Negotiate> | <Basic>}] [-CannotChangePassword <System.Nullable[bool]>] [-Certificates <X509Certificate[]>] [-ChangePasswordAtLogon <System.Nullable[bool]>] [-City <string>] [-Company <string>] [-Country <string>] [-Credential <PSCredential>] [-Department <string>] [-Description <string>] [-DisplayName <string>] [-Division <string>] [-EmailAddress <string>] [-EmployeeID <string>] [-EmployeeNumber <string>] [-Enabled <System.Nullable[bool]>] [-Fax <string>] [-GivenName <string>] [-HomeDirectory <string>] [-HomeDrive <string>] [-HomePage <string>] [-HomePhone <string>] [-Initials <string>] [-Instance <ADUser>] [-LogonWorkstations <string>] [-Manager <ADUser>] [-MobilePhone <string>] [-Office <string>] [-OfficePhone <string>] [-Organization <string>] [-OtherAttributes <hashtable>] [-OtherName <string>] [-PassThru <switch>] [-PasswordNeverExpires <System.Nullable[bool]>] [-PasswordNotRequired <System.Nullable[bool]>] [-Path <string>] [-POBox <string>] [-PostalCode <string>] [-ProfilePath <string>] [-SamAccountName <string>] [-ScriptPath <string>] [-Server <string>] [-ServicePrincipalNames <string[]>] [-SmartcardLogonRequired <System.Nullable[bool]>] [-State <string>] [-StreetAddress <string>] [-Surname <string>] [-Title <string>] [-TrustedForDelegation <System.Nullable[bool]>] [-Type <string>] [-UserPrincipalName <string>] [-Confirm] [-WhatIf] [<CommonParameters>]

 

常用字段注解:

Name 姓名
AccountExpirationDate 账户到期时间
City 城市
Company 公司
Department 部门
Description 描述
DisplayName 显示名称
EmailAddress 电子邮件地址
EmployeeID 员工ID
EmployeeNumber 员工编号
HomePhone 家庭电话
Manager 经理
MobilePhone 移动电话
Office 办公室
OfficePhone 办公室电话
Organization 组织
PasswordNeverExpires 密码永不过期
SamAccountName 用户登录名(老版本/不带@)
StreetAddress 街道地址
Title 职称
UserPrincipalName UPN用户登录名带@符

例:创建wen帐号:

New-ADUser -Name wen -SamAccountName wen -UserPrincipalName wen@a.com -AccountPassword (ConvertTo-SecureString "P@ssw0rd" -asplaintext -force) -enabled $true -ChangePasswordAtLogon $false

image

 

文章最后,给大家分享几个有关微软全家桶学习参考链接,希望可以帮忙有需要的朋友。

  1. 中国区Azure文档库 
  2. Azure文档库及场景 
  3. 国际版Azure文档库 
  4. 国际版Azure解决方案 
  5. Microsoft 365文档库 
  6. Office 365文档库 
  7. Microsoft 文档库
  8. 自动化部署学习链接
  9. Cloud Perspectives 
  10. Microsoft 文档和学习主页 
  11. 微软MSDN网站 
  12. 微软TechNet 
  13. Microsoft Developer博客 
  14. Microsoft开发人员网站 
  15. Channel 9 
  16. TechNet库 
  17. 微软学习中心
  18. Handsonlabs
  19. Techcommunity
  20. Archived MSDN and TechNet博客 

欢迎关注微信公众号:小温研习社

posted @ 2019-02-21 23:31  Wenzhongxiang  阅读(1989)  评论(0编辑  收藏  举报