<?xml version="1.0" encoding="windows-1252"?>
<node id="298941" title="How can I get which Windows domain an IP belongs to?" created="2003-10-13 16:10:23" updated="2005-07-27 06:44:45">
<type id="115">
perlquestion</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
Hello&lt;br&gt;&lt;br&gt;

Does it exist some module to get the Windows domain a Windows host belongs to?.&lt;br&gt;&lt;br&gt;

From a Windows computer I can do:&lt;br&gt;
nbtstat -A 192.168.1.1&lt;br&gt;&lt;br&gt;

And this will give me the Windows domain and other things that I dont want.&lt;br&gt;&lt;br&gt;

But I want to loop througt several hundreds IP-addresses and match these to the Windows domains the belong to and write the result to a file.&lt;br&gt;&lt;br&gt;

I have a txt file with several IP-addresses like&lt;br&gt; 
IP.TXT&lt;br&gt;
192.168.1.1&lt;br&gt;
192.168.1.2&lt;br&gt;
192.168.1.3&lt;br&gt;&lt;br&gt;

The result file should be like this.&lt;br&gt;
192.168.1.1 domain35&lt;br&gt;
192.168.1.2 domain50&lt;br&gt;
192.168.1.3 domain 55&lt;br&gt;&lt;br&gt;&lt;br&gt;

//Anders Andersson</field>
<field name="reputation">
6</field>
</data>
</node>
