积极答复者
咨询是否有命令可以直接验证用户密码是否正确

问题
答案
-
你好,
如果是未加域的计算机,可以使用以下命令进行判断,如果正确则可以正常打开notpad,如果密码错误则无法打开。
runas /noprofile /user:pcname\username "notepad"
这个办法并不是专门用来测试密码的,但是可以判断对错。
如果是域用户,除了上述方法之前,可以使用Powershell命令:
Function Test-ADAuthentication {
param($username,$password)
(new-object directoryservices.directoryentry "",$username,$password).psbase.name -ne $null
}
PS C:\> Test-ADAuthentication "\用户名" "mypassword"
True例如:
Fan
Please remember to mark the replies as an answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com
- 已标记为答案 ice9898 2020年8月27日 5:30
全部回复
-
Hi,
是什么样的用户密码呢,APP,域还是什么其他的
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com. -
你好,
如果是未加域的计算机,可以使用以下命令进行判断,如果正确则可以正常打开notpad,如果密码错误则无法打开。
runas /noprofile /user:pcname\username "notepad"
这个办法并不是专门用来测试密码的,但是可以判断对错。
如果是域用户,除了上述方法之前,可以使用Powershell命令:
Function Test-ADAuthentication {
param($username,$password)
(new-object directoryservices.directoryentry "",$username,$password).psbase.name -ne $null
}
PS C:\> Test-ADAuthentication "\用户名" "mypassword"
True例如:
Fan
Please remember to mark the replies as an answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com
- 已标记为答案 ice9898 2020年8月27日 5:30