When you have many roaming users, you often need to know which computer a user is logged on to. Trying to have a user find a computer name inside the OS or on a small label (which is often missing) placed somewhere on the computer isn't always an easy task. As a result, this task is often time consuming. And sometimes you just want to know what computer a user is logged on to without having to speak to the user.
Fortunately, there's an alternative. You can use a simple command to get a computer name from a username, then ping that user's machine to see whether the user is logged on. DNS and the Dnscmd tool make this possible. You can find Dnscmd in the \Support\Tools directory of your Windows OS CDROM. You can run this tool on any Windows Server 2003, Windows XP, or Windows 2000 machine.
Using Dnscmd, you can get a user's initials registered in DNS with the computer name the user logs on to. In our DNS, I created a domain named users under the domain forward lookup zone (e.g., users.company.com). Now I can use Dnscmd to register an alias, or CNAME, resource record for a user when the user logs on. I use the Dnscmd command with the /recordadd switch and CNAME option, which follows the syntax
In this syntax, ServerName specifies the DNS server's name. ZoneName and NodeName specify the name of the zone and node, respectively, that contain the record.
Host|DomainName specifies the Fully Qualified Domain Name (FQDN) of the DNS host and domain that you want to add to that record. For example, for a roaming user with the initials XXX who logs on to a computer called PC1, the command
%username% .users CNAME
creates a CNAME entry named XXX under the newly created users. companyname.com. This entry contains the FQDN PC1.companyname.com.
Now that there's an alias registered for the user, you can type
ping -a XXX.users
to ping the user's computer to see whether the person is logged on.
To delete this record when the user logs off, you can use the /recorddelete switch with the CNAME option in the command