Solved

Scripting question, generate report of machines showing which domain they are joined to

Posted on 2006-11-02
1
138 Views
Last Modified: 2010-03-18
I need to script or otherwise automate a report through vbscript or batch file, to scan a particular IP range and report on machine name and which domain the machine is joined to.  I am sure windows has some dos utilities that will accomplish this, so if anyone has a good  script example you could send me, I'd appreciate it.

Thanks
Joe
0
Comment
Question by:MCPJoe
1 Comment
 
LVL 43

Accepted Solution

by:
Steve Knight earned 500 total points
ID: 17858170
nbtstat will report that:  nbtstat -a hostname, i.e. with a list of hosts in hostlist.txt, one per line something like this should run down the list then extract the domain name from the nbtstat output.  Can't test here at the mo. so report back any syntax errors or if it doesn't work for you.
Steve

@echo off
for /f "tokens=*" %%a in (hostlist.txt) do call :process %%a
goto end
:process

for /f "tokens=1" %%x in ('nbtstat -a %1 ^| find "<1F>"') do echo %1, %%x >> domlist.txt
:end
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Enterprise networks where VoIP phones have been deployed frequently use port configurations that allow both a computer and an IP phone to be plugged into the same switch port but use different VLANs. On Cisco equipment I'm referring to the "native V…
This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

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

12 Experts available now in Live!

Get 1:1 Help Now