Solved

batch file for nbtstat -a and write results to log

Posted on 2011-03-15
2
1,713 Views
Last Modified: 2012-05-11
Hi,
i need to find a whole bunch of UID's logged onto various machine IP's.
Rather than manually go through each one, i would like to create a bat file that will do the following:

read a source txt file for IP's
run nbtstat -a to listed IP's
write UID part from the output to a txt file.

Thanks guys.
0
Comment
Question by:-P-Henderson
2 Comments
 
LVL 9

Accepted Solution

by:
Vampireofdarkness earned 500 total points
ID: 35145049
This is as far as I got, before running out of time

@echo Off

IF EXIST ip-output.txt DEL ip-output.txt

FOR /f %%i IN (ips.txt) DO nbtstat -a %%i | find "<00>  UNIQUE">> tmp.txt
FOR /f "tokens=1,2,3,4,5 delims= " %%e IN (tmp.txt) DO echo %%e >>ip-output.txt
 
del tmp.txt

Open in new window


You need ips.txt in the same folder as the .bat, I used one IP as an example. The ip-output.txt shows "DESKTOP" (which is the name of my PC). I understand from google that the UID is meant to be <03>, but I don't have <03>. I do have <00>.

Perhaps it can help? Perhaps I'm completely off-mark.
0
 

Author Closing Comment

by:-P-Henderson
ID: 35146461
Worked a treat, thankyou.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

When replacing some switches recently I started playing with the idea of having admins authenticate with their domain accounts instead of having local users on all switches all over the place. Since I allready had an w2k8R2 NPS running for my acc…
As dyndns has reduced the capabilities of the free service, I looked around for other free providers of Dynamic DNS service. After testing several I decided to move my DNS hosting to Hurricane Electric as then domains that require dynamic hostnam…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now