![如何使用 WMIC 连接远程机器并将操作系统信息输出到文件?](https://linux22.com/image/684862/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%20WMIC%20%E8%BF%9E%E6%8E%A5%E8%BF%9C%E7%A8%8B%E6%9C%BA%E5%99%A8%E5%B9%B6%E5%B0%86%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E4%BF%A1%E6%81%AF%E8%BE%93%E5%87%BA%E5%88%B0%E6%96%87%E4%BB%B6%EF%BC%9F.png)
我想知道如何使用 WMIC 连接到远程主机并将其电脑的操作系统信息(已安装的程序列表)输出到文件。
我试过
wmic /node: <IP address> OS get vendor, name > c:\output.txt
但我得到了错误"Node - <IP> Error: Description = Invalid query"
但实际上,我认为我需要成为域管理员才能获得权限。所以我尝试了
wmic /node: <IP> /domain: <domain.inc> /user:administrator /password:<password> OS get vendor, name > c:\output.txt
我收到错误:Invalid Global switch.
我想使用 WMIC 获取所有 PC 的操作系统信息(已安装的程序列表)。(我想我需要以域管理员的身份访问,因为所有 PC 都已加入域)而我是一名管理员
请...帮帮我ㅠ____ㅠ啊,当我仅用我的电脑尝试时似乎没问题。
WMIC /output:C:\%computername%.txt product get name, vendor, version
WMIC OS 获取名称、供应商、版本 >> C:\%computername%.txt
如果我像上面那样做,就可以获取 txt 文件。但我想远程所有电脑并获取信息文件...@_@~~~~
还有一个问题>>它是否与安全策略或组策略等有关?或防火墙等..........@_@;;
答案1
os get vendor
- 不存在操作系统供应商,这就是 的来源invalid query
。查看可用属性 - 有版本,但没有供应商:
C:\>wmic os get /?
Property get operations.
USAGE:
GET [<property list>] [<get switches>]
NOTE: <property list> ::= <property name> | <property name>, <property list>
The following properties are available:
Property Type Operation
======== ==== =========
BootDevice N/A N/A
BuildNumber N/A N/A
BuildType N/A N/A
CSDVersion N/A N/A
CSName N/A N/A
CodeSet N/A N/A
CountryCode N/A N/A
CurrentTimeZone N/A N/A
Debug N/A N/A
Description N/A N/A
Distributed N/A N/A
EncryptionLevel N/A N/A
ForegroundApplicationBoost N/A N/A
FreePhysicalMemory N/A N/A
FreeSpaceInPagingFiles N/A N/A
FreeVirtualMemory N/A N/A
InstallDate N/A N/A
LastBootUpTime N/A N/A
LocalDateTime N/A N/A
Locale N/A N/A
Manufacturer N/A N/A
MaxNumberOfProcesses N/A N/A
MaxProcessMemorySize N/A N/A
Name N/A N/A
NumberOfLicensedUsers N/A N/A
NumberOfProcesses N/A N/A
NumberOfUsers N/A N/A
OSLanguage N/A N/A
OSProductSuite N/A N/A
OSType N/A N/A
Organization N/A N/A
OtherTypeDescription N/A N/A
PlusProductID N/A N/A
PlusVersionNumber N/A N/A
Primary N/A N/A
QuantumLength N/A N/A
QuantumType N/A N/A
RegisteredUser N/A N/A
SerialNumber N/A N/A
ServicePackMajorVersion N/A N/A
ServicePackMinorVersion N/A N/A
SizeStoredInPagingFiles N/A N/A
Status N/A N/A
SystemDevice N/A N/A
SystemDirectory N/A N/A
SystemDrive N/A N/A
TotalSwapSpaceSize N/A N/A
TotalVirtualMemorySize N/A N/A
TotalVisibleMemorySize N/A N/A
Version N/A N/A
WindowsDirectory N/A N/A
/DOMAIN
并且wmic 中也没有选项。
C:\>wmic /?
[global switches] <command>
The following global switches are available:
/NAMESPACE Path for the namespace the alias operate against.
/ROLE Path for the role containing the alias definitions.
/NODE Servers the alias will operate against.
/IMPLEVEL Client impersonation level.
/AUTHLEVEL Client authentication level.
/LOCALE Language id the client should use.
/PRIVILEGES Enable or disable all privileges.
/TRACE Outputs debugging information to stderr.
/RECORD Logs all input commands and output.
/INTERACTIVE Sets or resets the interactive mode.
/FAILFAST Sets or resets the FailFast mode.
/USER User to be used during the session.
/PASSWORD Password to be used for session login.
/OUTPUT Specifies the mode for output redirection.
/APPEND Specifies the mode for output redirection.
/AGGREGATE Sets or resets aggregate mode.
/AUTHORITY Specifies the <authority type> for the connection.
/?[:<BRIEF|FULL>] Usage information.
您可以尝试:
wmic /NODE:"servername" /USER:"yourdomain\administrator" OS GET Name
它将提示您输入密码。