Solved

batch file for nbtstat -a and write results to log

Posted on 2011-03-15
2
1,807 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Implement VSS on 6509 Switches 52 126
Adding a new router 21 131
Apple iPhones DOS'd my network 3 46
Outdoor Wifi Radio with Splash Page 6 69
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…
Managing 24/7 IT Operations is a hands-on job and indeed a difficult one. Over the years I have found some simple tips and techniques to increase the efficiency of the overall operations. The core concept has always been on continuous improvement; a…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

751 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