There's four different ways I've done this... but none of them are scripting.

1. a. At the cmd prompt type net send username "". Replace username with the user you are trying to locate.
b. Regardless of whether you receive an error message or not type "nbtstat -c" at the command prompt.
c. Look for the username and corresponding IP.
d. If you need the computername and not just IP do a ping -a IPaddress.

2. If your using an NT4 Wins server you can search for a username.

3. If you have auditing successful logons enabled you can check the PDC and BDC's security event log.

4. As a last resort you can use a tool such as psloggedon which will connect to each computer in your domain looking to see if the user is logged on there. This is very time consuming and my least favorite.