# Solved: 2 quick batch questions



## valis (Sep 24, 2004)

1. is there a way to export all pc names on a particular subnet, such as 172.20.12.xx to a spreadsheet or text file? Would imagine so, seems a fairly simple thing to take care of. Just don't know my batch language yet.

2. is there an easy way to get the sp status from a variety of XP machines on that same subnet?

I've been tasked upping all available XP rigs to SP3, and as opposed to walking around to all machines and hitting winver, I'd rather go out armed with the knowledge of which machines need what.

thanks, 

v


----------



## peterh40 (Apr 15, 2007)

1. Does the network use DHCP, if so you can use the DHCP console and export the names, ip and potentially the mac addresses to a text file using Netsh dhcp dump command. 

2.Are these machines part of a workgroup or a domain. If they are in a domain, you can use VBS and ADSI API to interrogate the AD database for OS and SP versions.


----------



## valis (Sep 24, 2004)

both dhcp and domain........I am pretty sure one can hit the AD to query it, I just don't know the syntax. I'm mobile now, will be back on the domain menana.

Thanks, 

v


----------



## peterh40 (Apr 15, 2007)

Check out this page for ADSI: http://msdn.microsoft.com/en-us/library/aa772170(VS.85).aspx


----------



## Squashman (Apr 4, 2003)

There are plenty of utilities out there to scan a network to find out what computers are on the Network. SuperScan is pretty good at. You could also use something like NBTdump or NBTscan.
Joeware has a nice free utility called FindNBT.
http://www.joeware.net/freetools/tools/findnbt/index.htm

There is a program that can query what hotfixes and SP's that are on a Windows machine. I just can't remember the name of it off hand.

As far as getting SP3 installed. I would look at setting up WSUS to push it down but you should be able to deploy it with a GPO.


----------



## Squashman (Apr 4, 2003)

Found it. QFEcheck.


----------



## TheOutcaste (Aug 8, 2007)

Once you have the names, lots of ways to get the Service Pack. Run either of these commands in a For loop:

```
systeminfo /S <PC Name> |Findstr /I /B /C:"OS Version"

C:\>systeminfo /S XP-SP3 |Findstr /I /B /C:"OS Version"
OS Version:                5.1.2600 Service Pack 3 Build 2600
```


```
wmic /Node:<PC Name> OS get ServicePackMajorVersion, ServicePackMinorVersion /Format:CSV


C:\>wmic /Node:XP-SP2 OS get ServicePackMajorVersion, ServicePackMinorVersion /Format:CSV

Node,ServicePackMajorVersion,ServicePackMinorVersion
XP-SP2,2,0
```


----------



## valis (Sep 24, 2004)

Squashman said:


> Found it. QFEcheck.


that did it. Thanks guys, marking this solved.


----------

