是否有 Windows 等效的 Unix“whoami”命令?如果是,那是什么?
我可以成功地使用 Powershell 来判断用户是否在 Active Directory 中进行了身份验证:
Function Test-ADAuthentication {
param($username,$password)
(new-object directoryservices.directoryentry "",$username,$password).psbase.name -ne $null
}
Test-ADAuthentication "test" "Password1"
Run Code Online (Sandbox Code Playgroud)
但是,我终生无法弄清楚如何:
这怎么可能呢?