It's just data dumped using ipconfig, and tcpdump along with a WMI query. It's just old raw data I've collected over time that I want to move into a better format.
The first part is something like this:
echo %date% %time% >> \\networkpath\to\logs\%computername%
ipconfig /all | find /i "Host Name" >> \\networkpath\to\logs\%computername%
ipconfig /all | find /i "Description" >> \\networkpath\to\logs\%computername%
ipconfig /all | find /i "IPv4 Address >> \\networkpath\to\logs\%computername%
ipconfig /all | find /i "Default Gateway" >> \\networkpath\to\logs\%computername%
ipconfig /all | find /i "Physical Address" >> \\networkpath\to\logs\%computername%
That generates something like this:
Sun 10/19/2014 20:48:46.61
Host Name . . . . . . . . . . . . : COMPUTERABCD123
Description . . . . . . . . . . . : Microsoft Virtual WiFi Miniport Adapter
Description . . . . . . . . . . . : Intel(R) Centrino(R) Advanced-N 6205
Description . . . . . . . . . . . : Broadcom NetXtreme 57xx Gigabit Controller
IPv4 Address. . . . . . . . . . . : 123.213.123.213(Preferred)
Default Gateway . . . . . . . . . : 123.213.213.123
Physical Address. . . . . . . . . : EE-88-B4-31-A5-83
Physical Address. . . . . . . . . : EE-88-B4-31-A5-82
Physical Address. . . . . . . . . : EE-AC-6F-CA-DF-80
Because of the way it was filtered you have to line up the first description with the first physical address and so on.
Then it runs a tcpdump command that waits for a cisco CDP packet and filters for the lines that have information on the switch
Since some of the computers have ethernet, wifi, and something else, this portion of the log is sometimes empty unless I change the parameters to check on nic 2, nic 3 etc.
If it works correctly, it will dump something like this:
Device-ID (0x01), length: 10 bytes: 'SWITCH3B'
Port-ID (0x03), length: 15 bytes: 'FastEthernet4/1'
Platform (0x06), length: 14 bytes: 'cisco WS-C4506'
Address (0x02), length: 13 bytes: IPv4 (1) 213.123.121.211
Native VLAN ID (0x0a), length: 2 bytes: 244
Duplex (0x0b), length: 1 byte: full
ATA-186 VoIP VLAN request (0x0e), length: 3 bytes: app 1, vlan 344
And the final line of the program is
wmic bios get serialnumber
That generates a line like this:
SerialNumber
XYZABC123
It's all raw like that because I had a specific need at the time to trace down a computer's location on the network when it couldn't be located. It ended up being useful so I decided to just keep gathering the data. I keep capturing the serial number and name because sometimes computers get renamed but the serial number is permanent, so it would make a good primary key in a database.
Once I get my legacy data stored I'll work on rewriting the data collection script to wrap XML tags around individual items.