You'll find what you need via Windows Management Intrumentation (WMI) in the Win32_NetworkAdapterConfig
I'm working to automate some information gathering about our many DNS servers in the enterprise. I've run across a snag. For DNS zones that are configured to forward unresolved queries to WINS, I cannot seem to pull which WINS servers are specified via script.
As part of my script I'm pulling information from the root\MicrosoftDNS WMI namespace, specifically from the MicrosoftDNS_Zone namespace. In this namespace, each zone has a property called 'UseWins'. With this property I can successfully gather which zone(s) are forwarding to WINS. Unfortunately Windows doesn't seem to store the WINS servers in use under this same WMI namespace.
I've found for non-AD integrated DNS zones, the WINS information is stored in the DNS text file for the zone. I guess I could pull that info from here, however where does AD integrated zones store this information??
Does anyone have any ideas how to get this information?
TIA,
MCDONAMW
In MicrosoftDNS_Zone, there's an
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thank you for both of your responses above. Unfortunately neither help in my situation.
@ChiefIT: DNS does in fact work with WINS. While yes, WINS shouldn't need to be used in most cases, there are many cases where it still must exist. My company for example still has an NT4 domain (trying really hard to phase out). As such WINS is a requirement. Also in a company that has many disparate domains, WINS often helps with communications between all of these domains. Otherwise we have to go setting DNS suffices on all of the workstations that need to cross domains. Unfortunately using FQDN isn't always an option.
BTW, see here to cure your disbelief :) - http://technet.microsoft.c
@graye:
Your WMI query is pulling the WINS addresses that are tied to the NIC itself of a system. What I am referring to is a configuration within the Microsoft DNS Administration tool for DNS servers. This is a completely seperate thing. See attached screenshot for example.
Anyhow, thanks again to you both for attempting to help!
-mcdonamw
Well go figure. The link I produced for ChiefIT may lead to a solution. That URL is: http://technet.microsoft.c
Based on the information at this URL, when this option is selected in the DNS admin tool, new resource records are added to the zone containing the WINS servers that were entered in the configuration. I would think I would simply just need to query for those records from within the zone.
When I look at the zone records from within the DNS admin tool, I do indeed see new resource records of a "WINS Lookup" type. The URL above also states that these WINS records are included as part of a zone transfer, however I do not see these records while doing zone transfers using standard DNS tools (e.g., NSLOOKUP/DIG). As such it seems there's no way for me to query for these records outside of the DNS tool, as far as I can tell anyway.
Anyone know how to pull these records?
-mcdonamw
systemroot\System32\Wins
You pull them from a pull partner: (See WINS replication pull partners)
http://technet.microsoft.c
Unfortunately, this doesn't help either. This is assuming WINS is installed on the same server in question. It's not. My DNS zone is set up with WINS forwarding to completely different servers. These server are what I'm trying to detect.
Once again I have to note, this has nothing to do with the WINS service itself. This is a configuration within DNS.
If it helps, I'm attaching another screenshot of what information I'm looking for. I simply need to find a way to command-line query for the WINS resource record (RR) listed underneath a zone. This record is only created if you configure WINS Forwarding on the DNS zone. No DNS tools I've tried can seem to pull this record (e.g., Dig, NSlookup, DNSCMD).
Thanks!
"NBlookup" is the WINS version of NSlookup:
http://support.microsoft.c
__________________________
NBTSTAT -r:
lists the names resolved by broadcast and by WINS:
In fact NBTSTAT -? gives you a list of commands for netbios translation
__________________________
In addition: >Netstat< or >Portqry< checks your ports to see if they are listening or blocked:
The ports for netbios over TCP/IP and Netbios over SMB are:
137 WINS Netbios port UDP
138 Netbios datagram UDP
139 Netbios datagram TCP
Netbios overSMB:
Netbios over SMB port 445 UDP
139 Netbios datagram port TCP
Portqry is used in this syntax:
portqry -n myserver -p both -o 127,128,129,445
or for further details:
http://support.microsoft.c
and can be downloaded here:
http://www.microsoft.com/d
__________________________
There is no tool that I know of, like DIG, for netbios/WINS. Unlike DNS, WINS is populated via netbios broadcasts upon boot.
Netsh is the closest you can get to a command line interface, (that could take the place of a console-based admins), for WINS:
Syntax and a full list of Netsh commands is avail here:
http://technet.microsoft.c
__________________________
If this is truley under DNS as its own lookup zone. DNS tools should be able to see these records, (like Dig). Other than that, WINS should be kept under a different folder, (systemroot\System32\Wins)
The tools used for WINS management usually assume you are querying the WINS server's database, rather than the DNS server's database for WINS records. I would try DNS tools to see what they bring up, since you are looking into the DNS zones for WINS records.
Just had a chance to look at your last post:
Ok, that record you pointed out, is a WINS server pointer record. So, it is querying the WINS database on the other server and not a forward lookup zone.
The WINS tools should work for you. Netsh as the command line console for WINS, NBlookup as a troubleshooting utility, portqry and netstat as a port utility, NBTstat will be mostly for Broadcasts and cache and a little querying on the server.
@ChiefIT:
With all due respect, you seem to be missing something integral to my question. What I'm referring to has *nothing* to do with NetBios. I am completely aware of the difference between WINS and DNS and the tools that are used to manage each. In fact I feel I'm pretty proficient at these tools/technologies. This special case, however, is throwing me off.
At any rate, to clarify what I'm looking for please look at the last screenshot I posted. I am looking for a DNS resource record that is added to the DNS zone. This RR is of type "WINS".
In this case, WINS is *integrated* into DNS. As such, WINS tools will not help. The standard Microsoft DNS admin utility can see the records (as indicated/highlighted by my screenshot), but standard command line tools seem to not have the ability to see them (or I just simply don't know how to query for these *special* RRs).
Thanks for your many attempts to help!
@ChiefIT
You snuck another post in before my last post... :)
"Just had a chance to look at your last post:
Ok, that record you pointed out, is a WINS server pointer record. So, it is querying the WINS database on the other server and not a forward lookup zone.
The WINS tools should work for you. Netsh as the command line console for WINS, NBlookup as a troubleshooting utility, portqry and netstat as a port utility, NBTstat will be mostly for Broadcasts and cache and a little querying on the server."
Herein lies the issue. In order to use a WINS tool, I have to know *which* server to point at. This server is what I'm trying to find!!! The WINS server that is highlighted in that last screenshot is *hardcoded* in the DNS admin utility. I don't actually want to *query* WINS. I want to find out which *WINS servers* are hardcoded into DNS. Does that make sense?
To make it more simple... say you have Server1 (that has DNS only installed). Server1 has Zone1 that is configured with WINS forwarder lookup, pointing to Server2 and Server3 (both WINS only servers). In this case, you currently don't know Server2 and Server 3 even exists as some other Admin set this up.
Your/My Goal: Query Server1 (it's the only server YOU are aware about) asking it "which WINS servers is your DNS zone forwarding to", and have it return Server2 and Server3.
That (SAME AS PARENT) record is just a pointer record to the WINS servers. DNS does the same thing. SAME AS PARENT to all DNS servers. It specifies the location of the WINS server so that DNS can access the WINS database. This is a form of a SRV (SeRVice) record that is added to DNS when you tell DNS to query WINS if DNS fails.
In other words, you are querying the WINS database, not the DNS database for WINS records. Netsh and NBlookup will work for you.
@ChiefIT:
> That (SAME AS PARENT) record is just a pointer record to the WINS servers.
EXACTLY! I know this. This (Same as parent) pointer record to the WINS servers is what I'm trying to query for. DNS command line tools seem to not be able to *see* this record. I have no intention of actually finding anything further than this (which would require a netbios lookup tool). I'm simply looking to find out how a DNS server and its zones are configured. This WINS RR is the only thing tripping me up.
It looks like you now know what I'm looking for based on your last post. If you find anything, I'd love to hear it! Thanks again!
The record sits in the zone file like this:
@ 0 WINS L2 C900 ( 1.2.3.4 )
Where 1.2.3.4 would be replaced a space delimited list of WINS servers, and @ is the zone name, or "same as parent folder".
You can query for it with NsLookup where domain.com is replaced with the zone name:
NsLookup -q=wins domain.com
Dig can't, it doesn't have a definition for the "WINS" record type (afaik).
You can get it from WMI as well:
http://msdn.microsoft.com/
A quick PowerShell snippet to get that would be:
Get-WMIObject -Namespace root\MicrosoftDNS -Class MicrosoftDNS_WINSType -Computer server
Equally possible in VbScript, but I'm heading out now (making the most of the bank holiday) but if you need it I'll happily post how later on (probably tomorrow morning).
Chris
Thank you Chris!!!! I knew you could answer this with ease :). I tried most of my testing with Dig. I didn't get granular with NSLookup (shame on me for not testing that). I guess I assumed since Dig couldn't do it (with a zone transfer no less), then it just wasn't possible.
Thanks again. I should be good to go now!
-MCDONAMW
Correct about the zone file, the data is held as a collection of dnsNode objects under a dnsZone. The actual record data is encoded in the (multi-value) dnsRecord attribute of those dnsNode objects as a Binary Large Object (which lacks any official documentation). I have a decode for most of the dnsRecord attribute here:
http://www.highorbit.co.uk
I must add the WINS record type to that though, forgot about it when I was testing the rest :)
Chris
Business Accounts
Answer for Membership
by: ChiefITPosted on 2009-08-20 at 15:13:16ID: 25147632
First off, you need to separate WINS and DNS. They are similar in many ways. In fact DNS was modeled after WINS, to replace WINS. I don't think they interact with one another.
I have heard this before that DNS will revert to a WINS query. But, I don't believe it. Most administrators, don't have a WINS database, at all. Instead they rely upon netbios broadcasts. That is saved in the cace files of every machine. To see your netbios cache, go to the command prompt and type NBTstat -c, I think. Since this is a cached value, it is saved on residual memory, not a hard drive location.