获取所有计算机的列表网络上的W / O DNS计算机、列表、网络、DNS

2023-09-02 01:59:41 作者:任凭时间蹉跎我只爱你

问候,

我需要的方式(通过C#或在一个bat文件),以获得在给定网络上的所有计算机的列表。通常情况下,我使用NET VIEW,但这往往工作(从我的理解),只在你的域名。我需要的所有计算机的名称(或者至少是IP地址),可用我的网络上。

I need a way (either via C# or in a .bat file) to get a list of all the computers on a given network. Normally, I use "net view", but this tends to work (from my understanding) only within your domain. I need the names (or at least the IP Addresses) of all computers available on my network.

如果能够得到一个域中所有计算机的不是我(在这种情况下,我会使用工作组,或任何默认是)也将正常工作。

Being able to get all computers on a domain that isn't mine (in which case I'd use WORKGROUP, or whatever the default is) would also work.

推荐答案

Nmap的有利于本 - 使用 - 对于操作系统指纹和-oXfilename.xml中为输出为XML输出​​选件,你然后,可以从C#解析。

Nmap is good for this - use the -O option for OS fingerprinting and -oX "filename.xml" for output as xml that you can then parse from c#.

一个合适的命令行会(其中是192.168.0.0/24子网扫描):

A suitable commandline would be (where 192.168.0.0/24 is the subnet to scan):

nmap -O -oX "filename.xml" 192.168.0.0/24

离开了-O如果你在猜操作系统不感兴趣 - 如果你只是想ping扫描使用-sP,或阅读文档的无数其他选项

leave out the -O if you aren't interested in guessing the OS - if you just want a ping sweep use -sP, or read the docs for the myriad other options.