PowerShell - 用户必须在下次登录时更改密码

问题描述 投票:0回答:1

这就是我所拥有的,除了我需要用户在登录时更改密码的部分外,一切都很有效

Import-Csv C:\Users\user\Desktop\newuser.csv | New-ADUser -PassThru | Set-ADAccountPassword -Reset -NewPassword (ConvertTo-SecureString -AsPlainText '@To03PXaz4' -Force) -PassThru | Enable-ADAccount -PassThru | Set-Aduser -ChangePasswordAtNextLogon $true

任何指导将不胜感激

powershell active-directory change-password
1个回答
1
投票

语法是-ChangePasswordAtLogon,而不是-ChangePasswordAtNEXTLogon。见https://technet.microsoft.com/en-us/library/hh852287(v=wps.630).aspx

使用Set-Aduser -ChangePasswordAtLogon $true应该可以解决您的问题。

© www.soinside.com 2019 - 2024. All rights reserved.