【发布时间】:2021-10-09 23:55:32
【问题描述】:
甚至不确定这是否可能?有没有办法只使用用户主体名称来重置用户的 AD 密码。通常,我必须依靠他们的 AD 用户名。
他们的 UPN 与他们的电子邮件地址相同,这就是我想使用的。
例如,对于名为 John Smith 的用户,他的 UPN/电子邮件是 joh.smith@thiscompany.com,他的 AD 帐户名称(SAM 名称)是 Jsmith。目前,我主要做了以下工作:
确认安全问题:
Get-ADUser jsmith -Properties * | Select RD8SecurityQuestions
更改密码:
Set-ADAccountPassword jsmith -Reset -NewPassword (ConvertTo-SecureString -AsPlainText "password1" -Force -Verbose) -PassThru
下次登录时需要更改密码:
Set-ADUser -Identity jsmith -ChangePasswordAtLogon $true
到目前为止,我发现您可以通过以下方式获得安全问题:
Get-ADUser -Filter {EmailAddress -eq 'john.smith@thiscompany.com'} -Properties * | Select RD8SecurityQuestions
但我不知道如何执行其他两个步骤,或者如果有一些明显的东西我遗漏了。
【问题讨论】:
标签: powershell active-directory