通过Powershell命令检查远程机器的OS类型是否为2008 R2

Check Whether the OS Type of the Remote Machine is 2008 R2 by Powershell Command

我在我的 C++ 代码中使用了以下命令来获取远程机器的系统信息

systeminfo /s 192.168.102.34 /u Administrator

但我需要使用c++代码检查远程机器的OS类型是否为2008 R2。所以我想单独使用 OS 类型。我如何将它与单独的 os 类型进行比较。

试试这个:

wmic /Node:hostname os get Name