So this is my XML report from NMAP:
<?xml version="1.0" encoding="utf-8" ?>
<nmaprun scanner="nmap" args="nmap -F –script=smb-os-discovery –script=nbstat -oX c:\NMAP\Temp2\result3.xml 1.1.1.1" start="1327070530" startstr="Fri Jan 20 09:42:10 2012" version="5.51" xmloutputversion="1.03">
<scaninfo type="syn" protocol="tcp" numservices="100" />
<verbose level="0" />
<debugging level="0" />
<status state="up" reason="echo-reply" />
<address addr="1.1.1.1" addrtype="ipv4" />
<hostname name="test.test.com" type="PTR" />
</hostnames>
<script id="nbstat" output="NetBIOS name: test, NetBIOS user: <unknown>, NetBIOS MAC: 00:00:00:00:00:00 (USI) Names OF060L3A0760X<00> Flags: <unique><active> OF060L3A0760X<20> Flags: <unique><active> TEST<00> Flags: <group><active> TEST<1e> Flags: <group><active> TEST<1d> Flags: <unique><active> x01x02__MSBROWSE__x02<01> Flags: <group><active>" />
<script id="smb-os-discovery" output="OS: Windows XP (Windows 2000 LAN Manager) Name: TESTtest System time: 2012-01-20 09:41:19 UTC-5" />
</hostscript>
I know how to get all the information from nmarun.host.hostscript.script.output, but I need only MAC, OS and Name nothing else….. and somehow to create table with all 3 items and | export-csv
Thanks in advance