Check out your Windows net

Ever wondered what NT service pack versions are out in your domain? Or what version of IE? With a couple of NT Reskit utilities, a text editor and a search utility software, you can have the information from all (live) machines in your domain very quickly.

1. Use Netdom.exe (NT Resource kit) to dump out your domain list. Here is an example of two lines contained in a batch file to perform this:


netdom /D:yourdomainname /noverbose bdc >> C:yourdomainname%1.TXT
netdom /D:yourdomainname /noverbose member >> C:yourdomainname%1.TXT

Substitute your domain name where indicated above. When running the batch file, you can enter an argument right after the command (such as the date). This will appear in name of the output file that is created. This output file will contain the domain list with all member servers/workstations and BDCs. (You will have to add the PDC to the list manually if you want it.)

2. Edit the list with an editor that can edit in columns. I use Excel, but another one I have heard of is Ultra-Edit by IDMCOMP. We will add commands and logging in different columns.

For checking NT SP versions, here is an example line of code that uses reg.exe from the NT Resource kit:


Requires Free Membership to View

reg query "softwaremicrosoftwindows ntcurrentversioncsdversion" machinename >>c:checksp.txt

If you use Excel to edit your text file, save it as a .bat file. You may have to re-edit it in Notepad when you are done if you use quotation marks on a path (necessary if spaces are in it)--Excel seems to add extra quotation marks. This particular code will return information into a text file called "checkSP.txt". Here is an example of the output:


Connecting to remote machine machinename
REG_SZ csdversion Service Pack 6

Now you can scan the output file with a search utility (such as "Search and Replace for Windows" by Funduc Software Inc.) to count instances of SP 6, etc.

You can perform the same kind of process to search IE version. Here is a sample code line for the (second) batch file:


reg query "softwaremicrosoftinternet explorerversion" machinename >>c:checkIE.txt

It returns results in a file called "checkIE.txt", an example of the output would be:


Connecting to remote machine machinename
REG_SZ version 5.00.2919.6307

(A list of IE versions is available in MS Technet).

The same process can be used as well to check for the existence of files on machines. Sample code for the (second) batch file:


If exist machinenamec$folderfilename echo machinename has it! >>c:filecheck.txt

The output file "filecheck.txt" will contain only the positive results (with the machine name) of the search.

You can do plenty with this simple but effective command-line/batch file technique. I use it often for real-time mass-checking.

This was first published in August 2001

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.