windows创建隐藏账户_如何创建所有Windows用户帐户及其设置的纯文本列表

本文介绍了如何使用命令提示符和WMIC命令行工具在Windows上获取用户账户的详细列表,包括如何创建打印机友好的文本文件。内容涵盖了不同级别的用户账户信息,如账户名称、全名、状态等,并展示了如何将结果重定向到文件,以便保存或打印。
摘要由CSDN通过智能技术生成
windows创建隐藏账户

windows创建隐藏账户

ual_top

You can always look up user accounts on a Windows system using the settings interface, but if you want to save a nice, printer-friendly file with that info, it’s easiest to turn to the Command Prompt.

您始终可以使用设置界面在Windows系统上查找用户帐户,但是如果您想使用该信息保存一个漂亮的,打印机友好的文件,则最简单的方法是转到命令提示符。

Windows provides a couple of ways to interact with user accounts at the Command Prompt. You already may be familiar with the first option: the net user command. Here, we’re going to turn to a second option: the Windows Management Instrumentation Command-line (WMIC), which is really just an extended command line structure for performing various types of system management. You can do all kinds of things with the WMIC command, even cool hardware stuff like checking your motherboard model number. We’re going to be using the useraccount command portion of WMIC because it provides more details and options than the net user command.

Windows提供了两种在命令提示符处与用户帐户进行交互的方式。 您可能已经熟悉第一个选项: net user命令。 在这里,我们将转到第二个选项:Windows Management Instrumentation命令行(WMIC),它实际上只是用于执行各种类型的系统管理的扩展命令行结构。 您可以使用WMIC命令执行各种操作,甚至可以使用诸如检查主板型号之类的出色硬件。 我们将使用WMICuseraccount命令部分,因为它比net user命令提供更多的详细信息和选项。

To start using the WMIC command, you’ll need to open Command Prompt with administrative privileges. Press Windows+X on your keyboard, then select “Command Prompt (Admin)” from the Power Users menu.

要开始使用WMIC命令,您需要使用管理权限打开命令提示符。 在键盘上按Windows + X,然后从“高级用户”菜单中选择“命令提示符(管理员)”。

ual_1

Note: If you see PowerShell instead of Command Prompt on the Power Users menu, that’s a switch that came about with the Creators Update for Windows 10. It’s very easy to switch back to showing the Command Prompt on the Power Users menu if you want, or you can give PowerShell a try. You can do pretty much everything in PowerShell that you can do in Command Prompt, plus a lot of other useful things.

注意:如果您在Power Users菜单上看到PowerShell而不是Command Prompt,那是Windows 10Creators Update附带的开关。 如果需要,可以很容易地切换回在“高级用户”菜单上显示命令提示符,或者可以尝试使用PowerShell。 您可以在PowerShell中完成几乎可以在命令提示符中执行的所有操作,以及许多其他有用的操作。

快速获取公正的用户帐户名称列表 (Get a Quick List of Just User Account Names)

If all you need is a list of account names without any other details, type the following command at the prompt and then press Enter:

如果您只需要一个帐户名称列表而没有其他任何详细信息,请在提示符下键入以下命令,然后按Enter:

wmic useraccount get name
ual_2

As you can see, you get a simple list with just the user account names. The first three names listed will always be the built-in administrator account, the default account used in the creation of new user accounts, and the guest account. After that, you’ll see listed any local or Microsoft accounts you’ve created on the system.

如您所见,您将获得一个仅包含用户帐户名的简单列表。 列出的前三个名称将始终是内置管理员帐户,用于创建新用户帐户的默认帐户以及来宾帐户。 之后,您会看到列出了您在系统上创建的所有本地或Microsoft帐户。

If you need just a bit more information, you can use the following command to list the user account name and the user’s full name if it’s been entered into the system:

如果只需要更多信息,可以使用以下命令列出用户帐户名和用户的全名(如果已将其输入到系统中):

wmic useraccount get name,fullname
ual_3

In this example, you can see that the “Michelle” and “Simon” accounts do not have full names associated, but my “wjgle” account does have my full name.

在此示例中,您可以看到“ Michelle”和“ Simon”帐户没有全名关联,但是我的“ wjgle”帐户却有我的全名。

获取具有更多详细信息的用户帐户列表 (Get a List of User Accounts with More Details)

If you’d like create a list of user accounts with a full set of account details, type the following command at the prompt and hit Enter:

如果要创建具有完整帐户详细信息的用户帐户列表,请在提示符下键入以下命令,然后按Enter:

wmic useraccount list full
ual_4

That image shows just one user account from the list with all its details. You can see the user account name and full name, as well as additional details like the following:

该图像仅显示列表中的一个用户帐户及其所有详细信息。 您可以看到用户帐户名和全名,以及其他详细信息,如下所示:

  • AccountType. If you’re on PC that is not part of a domain—which is almost certainly the case if you’re on your home or small business PC—you’ll always see an account type of 512. If the PC is part of a domain, you’ll see other values here that represent what type of domain account it is.

    AccountType 。 如果您使用的计算机不属于域,则几乎可以肯定,如果您使用的是家用或小型企业PC,则帐户类型始终为512。域,您将在此处看到其他值,它们代表该域帐户的类型。

  • Description. This value shows a description of the account if one has been entered.

    说明。 如果已经输入一个帐户,此值将显示该帐户的描述。

  • Disabled. This indicates whether the user account is active or disabled. If this value is set to FALSE, then the account is active.

    禁用的。 这表明用户帐户是激活的还是禁用的。 如果此值设置为FALSE,则该帐户处于活动状态。

  • Domain. This indicates the name of the domain the PC is part of. If the PC is not part of a domain, you’ll see an assigned name here beginning with the computer type.

    。 这表示PC所属的域的名称。 如果PC不属于域,则将在此处看到以计算机类型开头的分配名称。

  • InstallDate. On domains, this value will show the date the user account was created.

    InstallDate 。 在域上,此值将显示用户帐户的创建日期。

  • LocalAccount. This value denotes whether the account exists on the local computer or on a domain server if the computer is joined to a domain.

    LocalAccount 。 此值表示如果计算机加入域,则该帐户是存在于本地计算机上还是域服务器上。

  • Lockout. This value shows whether the user account is currently locked out, as can happen if security options lock accounts after a number of unsuccessful password attempts.

    停工。 该值显示用户帐户当前是否被锁定,如果安全选项在多次密码尝试失败后锁定帐户,就会发生这种情况。

  • PasswordChangeable, PasswordExpires, and PasswordRequired. These represent security options for passwords that may have been set for the user account.

    PasswordChangeablePasswordExpiresPasswordRequired 。 这些代表可能为用户帐户设置的密码的安全性选项。

  • SID. This value shows the security identifier (SID) for the account.

    SID 。 此值显示该帐户的安全标识符(SID)。

  • SIDType. This is a numerical value that shows the type of SID used for the account. You may see entries such as 1 for a user account, 2 for a group account, and 3 for a domain account.

    SIDType 。 这是一个数值,显示用于帐户的SID的类型。 您可能会看到条目,例如1代表用户帐户,2代表组帐户,3代表域帐户。

  • Status. This is the current status of the user account. If the account is operational, you’ll see an account status of “OK” or “Degraded,” which just means the account usable by regular users for logging on to the system.

    状态。 这是用户帐户的当前状态。 如果该帐户可运行,您将看到一个帐户状态为“确定”或“已降级”,这意味着普通用户可以使用该帐户登录系统。

And by the way, you can use any of those detail names separated by commas to get a modified list, much like how we did just the name and full name in the last section. For example, if you wanted to see just the name, full name, and status of the accounts, you could use the command:

顺便说一下,您可以使用任何用逗号分隔的详细信息名称来获取修改后的列表,就像我们在上一节中仅使用名称和全名一样。 例如,如果您只想查看帐户的名称,全名和状态,则可以使用以下命令:

wmic useraccount get name,fullname,status
ual_9

So, this is all well and good if you just want to view user account information on the fly, but it becomes much more useful when you redirect the results to a text file.

因此,如果您只想即时查看用户帐户信息,这一切都很好,但是当您将结果重定向到文本文件时,它会变得更加有用。

将命令结果重定向到文件 (Redirect the Results of a Command to a File)

It’s great being able to view a list of user account details at the Command Prompt, but the real usefulness of these commands lie in the fact that you can pipe the results straight into a file that you can then save or print. To do this with any wmic command, you just have to add an /output switch along with a path for the file directly after the wmic command.

能够在命令提示符处查看用户帐户详细信息列表真是太好了,但是这些命令的真正有用之处在于,您可以将结果直接传送到一个文件中,然后可以保存或打印。 要使用任何wmic命令执行此操作,只需在wmic命令之后直接添加/output开关以及文件路径。

For example, if you wanted to take the earlier command for getting a user account list with full details and redirect the output to a file named useraccounts.txt in a folder at C:\logs, you would first make sure the c:\logs folder already exists and then use the following command:

例如,如果您想使用较早的命令来获取具有完整详细信息的用户帐户列表,并将输出重定向到C:\ logs文件夹中名为useraccounts.txt的文件,则首先要确保c:\ logs文件夹已经存在,然后使用以下命令:

wmic /output:C:\logs\useraccounts.txt useraccount list full

When you use this command, you won’t see any results at all at the Command Prompt, but if you open the file you created, the list will be there.

使用此命令时,在命令提示符下根本看不到任何结果,但是如果您打开创建的文件,则列表将存在。

ual_6

And if you want to get even fancier, you could also direct the output to a comma-separated value (CSV) file that could then easily be imported into a spreadsheet app or database. The trick to this is that you’ll also have to add a /format:csv switch to the end of the command. So, for example, if you wanted to redirect the output of the same command we used above to a CSV file, you’d use something like the following command:

而且,如果您想变得更高级,还可以将输出定向到逗号分隔值(CSV)文件,然后可以将其轻松导入电子表格应用程序或数据库中。 诀窍是您还必须在命令末尾添加一个/format:csv开关。 因此,例如,如果您要将上面使用的同一命令的输出重定向到CSV文件,则可以使用以下命令:

wmic /output:C:\logs\useraccounts.txt useraccount list full /format:csv

Again, there’s no output at the Command Prompt, but you can see the results by opening the file itself.

同样,命令提示符处没有输出,但是您可以通过打开文件本身来查看结果。

ual_7

And if you import it into something like Microsoft Excel, you can have a nicely formatted table with little work.

而且,如果将其导入到Microsoft Excel之类的文件中,则可以不用任何工作就能得到格式正确的表。

ual_8

Of course, there’s a lot more you can do with the wmic useraccount command, including changing some of the user account details like whether an account is locked or unlocked. You can get more information on that by typing wmic /? at the Command Prompt. There’s also a whole lot more you can do with the wmic command in general. For more information on that, check out the official WMIC page from Microsoft and the list of useful WMIC queries from the Microsoft Performance Team blog.

当然,使用wmic useraccount命令可以做更多的事情,包括更改一些用户帐户详细信息,例如帐户是锁定还是未锁定。 您可以通过输入wmic /?获得更多信息wmic /? 在命令提示符处。 通常,使用wmic命令还可以做更多的事情。 有关更多信息,请查看Microsoft的官方WMIC页面以及Microsoft Performance Team博客中有用的WMIC查询列表。

翻译自: https://www.howtogeek.com/286707/how-to-create-a-plain-text-list-of-all-windows-user-accounts-and-their-settings/

windows创建隐藏账户

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值