Operating System - HP-UX
1838389 Members
3259 Online
110125 Solutions
New Discussion

Re: dhcp NT client user name

 
Cynthia Knight_1
New Member

dhcp NT client user name

How does a dhcp nt client's user name gets captured in a script on a unix machine. syslog just gives the pc name.

Thanks



1 REPLY 1
Kevin Ernst
Regular Advisor

Re: dhcp NT client user name

Cynthia:

If you've been spoiled by NT's DHCP server, it probably figures out usernames by doing a NetBIOS query on the machine name. It's understandable you'd want your Unix DHCP server to do the same thing, but NetBIOS isn't really a Unix-native protocol.

You could use the 'nmblookup' utility from the Samba suite (an SMB/CIFS filesharing package for Unices) to query each client for a list of NetBIOS names. I would imagine this is roughly the same way NT's DHCP server does it. A command line something like this should do:

nmblookup -S -A (if all you have is the IP address)
- or -
nmblookup -S (if you can resolve a hostname)

The results might be somewhat confusing, but the username--if there's currently a user logged in--will be in there, and can be parsed out using 'sed,' 'awk,' or even 'cut.' You can't count on the user always being logged in, though, so I don't know how useful that would be to you anyway.

You can get more information about Samba at http://www.samba.org, or , if you don't already have it, download CIFS/9000 (which basically *is* Samba) for HP-UX 11.x at http://www.software.hp.com .

Hope that helps.