Hi all... I need to make a few queries to WINS, but am unsure how to do so. 'nmblookup' will allow me to enter an IP address and get information about the machine name, domain, and username. I want to do the opposite...I would like to have a tool that will take a username and return the IP address. I know this information is stored in WINS somehow, and I am capable of writing some Perl scripts to connect to port 139 on a WINS server, but I don't know the 'handshake' or 'dialog' or 'conversation' that I will have to have with that port to get the information I want. If, for example, I am looking for the IP address for the user 'gwebster', what steps do I need to take to retreive this from the WINS server? Thanks, Greg Webster Systems Administrator Alexander Holburn Beaudin & Lang Barristers & Solicitors 2700 - 700 W. Georgia St. Vancouver, BC V7Y 1B8 Phone: (604) 688-1351 Direct: (604) 643-2146 Fax: (604) 669-7642 Email: gwebster@ahbl.ca Firm Web Site: http://www.ahbl.ca WARNING - CONFIDENTIALITY NOTICE This e-mail message and any attachments thereto are intended solely for the use of the individual or entity to whom it is addressed and contains information that is confidential and may be privileged and exempt from disclosure. Any distribution, copying or disclosure is strictly prohibited. If you have received this e-mail in error, please notify the sender immediately by return email and delete the message unread without making any copies. Thank you.
> If, for example, I am looking for the IP address for the user 'gwebster', > what steps do I need to take to retreive this from the WINS server?Would a simple smbstatus -S work? You could then parse the output into something that is useful for you to use. I've done it this way in the past. Nathan Ehresman
I would read man nmblookup and man smbclient. smbclient -L winserver shows all the clients. nmblookup netbiosname from the step above shows the ip address. This doesn't seem to work for cross subnets,though, so you might have to play with some other command line options. Joel On Wed, Jun 19, 2002 at 11:42:54AM -0700, WEBSTER, Greg wrote:> Hi all... > > I need to make a few queries to WINS, but am unsure how to do so. > 'nmblookup' will allow me to enter an IP address and get information about > the machine name, domain, and username. I want to do the opposite...I would > like to have a tool that will take a username and return the IP address. > > I know this information is stored in WINS somehow, and I am capable of > writing some Perl scripts to connect to port 139 on a WINS server, but I > don't know the 'handshake' or 'dialog' or 'conversation' that I will have to > have with that port to get the information I want. > > If, for example, I am looking for the IP address for the user 'gwebster', > what steps do I need to take to retreive this from the WINS server? > > Thanks, > > Greg Webster > Systems Administrator > Alexander Holburn Beaudin & Lang > Barristers & Solicitors > 2700 - 700 W. Georgia St. > Vancouver, BC V7Y 1B8 > Phone: (604) 688-1351 > Direct: (604) 643-2146 > Fax: (604) 669-7642 > > Email: gwebster@ahbl.ca > Firm Web Site: http://www.ahbl.ca > > WARNING - CONFIDENTIALITY NOTICE > This e-mail message and any attachments thereto are intended solely for the > use of the individual or entity to whom it is addressed and contains > information that is confidential and may be privileged and exempt from > disclosure. Any distribution, copying or disclosure is strictly prohibited. > If you have received this e-mail in error, please notify the sender > immediately by return email and delete the message unread without making any > copies. Thank you. > > -- > To unsubscribe from this list go to the following URL and read the > instructions: http://lists.samba.org/mailman/listinfo/samba
--On 06/19/2002 11:42 AM -0700 WEBSTER, Greg wrote: } If, for example, I am looking for the IP address for the user 'gwebster', } what steps do I need to take to retreive this from the WINS server? "nmblookup" can do that. A live example of me looking up my login name, returning the machine I'm logged in on:>nmblookup -U ussjodns01 -R "jimw#3"querying jimw on 167.116.93.31 167.116.93.181 jimw<03> There's an example in the manpage for nmblookup. All the WINS registered tags are enumerated and explained in the Microsoft Knowledge Base article q119495. } I am capable of } writing some Perl scripts to connect to port 139 on a WINS server, but I } don't know the 'handshake' or 'dialog' or 'conversation' that I will have to } have with that port to get the information I want. It's all there in the Samba sources. :-) Jim -- Jim Watt wattjg@appliedbiosystems.com Applied Biosystems Voice (desk): +1 408 577 2228 3833 North First Street Fax: +1 408 894 9307 San Jose CA 95134-1701 Voice (main): +1 408 577 2200
> -----Original Message----- > From: Jim Watt [mailto:wattjg@appliedbiosystems.com] > Subject: Re: [Samba] WINS querying (Advanced) > "nmblookup" can do that. A live example of me looking up my login > name, returning the machine I'm logged in on: > > >nmblookup -U ussjodns01 -R "jimw#3" > querying jimw on 167.116.93.31 > 167.116.93.181 jimw<03> > > There's an example in the manpage for nmblookup.Yep, but it's not very clear and your above example doesn't do it here. I've read the Q119495 article as well for these names. For example...your query # nmblookup -U 10.0.10.9 -R "gwebster#3" querying gwebster on 10.0.10.9 wins_srv_died(): Could not mark WINS server 10.0.10.9 down. Address not found in server list. name_query failed to find name gwebster#03 While the following does give the opposite info: # nmblookup -U 10.0.10.9 -A 10.0.29.33 Looking up status of 10.0.29.33 AHBL29033 <00> - M <ACTIVE> AHBLNT1 <00> - <GROUP> M <ACTIVE> AHBL29033 <03> - M <ACTIVE> AHBL29033 <20> - M <ACTIVE> AHBLNT1 <1e> - <GROUP> M <ACTIVE> AHBL29033 <01> - M <ACTIVE> GWEBSTER <03> - M <ACTIVE>
Apparently Analagous Threads
- 2.2.5 upgrade bug report - winbindd and password servers
- Some notes...(and a compliment for Samba people)
- Samba and CUPS and drivers, oh my! (Why is this so **** hard?)
- Problem uploading printer drivers
- FreeBSD 4.5, Samba 2.2.4_1, W2K client "printer prope rties cannot be displayed"