使用vbscript,如何过滤WMI查询的输出?我想返回除“2”之外的每个本地用户帐户,即“管理员”和“访客”。
Set colUsers = objWMIService.ExecQuery _
("select * from Win32_UserAccount where LocalAccount = True")
For Each objUser in colUsers
WScript.Echo objUser.Name
Next
答案 0 :(得分:1)
只需将WQL
句重写为
objWMIService.ExecQuery("select * from Win32_UserAccount Where Name<>'Administrator' AND Name<>'Visitor' AND LocalAccount=True")