使用“net user / domain”时如何提供用户名和密码


0

就像标题所说,我想用 net user /domain 获取本地域中的用户列表。问题是,它归还给我 “访问被拒绝”错误。

我知道它需要登录到域,我知道用户名和密码。我应该如何传递我的凭据和 net user /domain 命令?

/user:username 不适合我。

Answers:


2

可能有更优雅的方式,但这应该工作:

runas /user:DOMAIN\USERNAME "net user /domain"

系统将提示您输入密码,然后运行密码。

顺便说一下,您可能也对Powershell cmdlet感兴趣 Get-ADUser

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.