千家信息网

Windows Server 2016-Powershell新建用户补充

发表于:2024-10-17 作者:千家信息网编辑
千家信息网最后更新 2024年10月17日,前边我们介绍到Windows Server 2016-图形化新建域用户(一) 及 Windows Server 2016-批量新建域用户(二) ,里边提到了批量通过new-aduser常见帐号,这里简
千家信息网最后更新 2024年10月17日Windows Server 2016-Powershell新建用户补充

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

命令语法:

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

常用字段注解:

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

例:创建wen帐号:

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

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

0