View difference between Paste ID: 5pRzXYNW and C0FVg2d5
SHOW: | | - or go back to the newest paste.
1
@echo off
2
setlocal enabledelayedexpansion
3
rem Requires WinDump @ http://www.winpcap.org/windump/install/
4
rem        + WinPcap @ http://www.winpcap.org/install/default.htm
5
rem   OR
6
rem          TCPDUMP @ http://www.microolap.com/products/network/tcpdump/
7-
echo Cisco CDP Port-ID Identifier v1.0 by Giovanni Heward (g@utahfd.com)
7+
echo Cisco CDP Port-ID Identifier v1.0 by Giovanni Heward (g[@]utahfd.com)
8
set app=windump
9
set output=\\?\UNC\127.0.0.1\c$\PortID.txt
10
rem Modify output to central share if desired (e.g. \\?\UNC\server.domain.local\share\path\PortID.txt )
11
for /f "tokens=4" %%i in ('route print -4 0.*^|find "0.0.0.0"') do (
12
	if not [%%i]==[Default] (
13
		for /f "tokens=3 delims=," %%s in ('wmic nicconfig get IPAddress^,SettingID /format:csv^|findstr "%%i"') do (
14
			for /f "delims=." %%i in ('!app! -D^|findstr "%%s"') do (	
15
				!app! -i %%i -nn -v -s 1500 -c 1 ether[20:2] == 0x2000 | findstr "Device-ID Address Port-ID Platform"
16
			)>!output!
17
		)
18
	)
19
)
20
if exist !output! type !output!