hey guys, here is my problem and I have the solution but I do not know how to code it...

Problem: when a user calls and us techs want to remote into their pc, the user doesnt know their pcname. we need the pcname to remote into the machine and help them.

solution:
I want to make a program that when executed it lists by branch# a list
of pcnames with the username who is localy logged on.

example

program is called findpcname.exe (using gui kix compiler)

output:

Branch 1:

PC1 rubers
PC2 bfinway
PC3 rvandyke
PC4 rsellers

Branch 2:

PC5 rmueller
PC6 rmiller
PC7 rjohnson
PC8 bbeulla


This is my what I dont know how to do:

I am using pstools shell command psloggedon -l \\pcname > found.txt
and what goes into this text file is this output below

 Quote:


Users logged on locally:
Error: could not retrieve logon time
NT AUTHORITY\LOCAL SERVICE
Error: could not retrieve logon time
NT AUTHORITY\NETWORK SERVICE
Error: could not retrieve logon time
DOMAINNAME\lrokke
Error: could not retrieve logon time
NT AUTHORITY\SYSTEM


I do not know how to extract the name beyond the domainname\?
I want to pull that name out and put it into a variable on the fly
while I am looping thru the list of pcnames? and then as I do this
it will be printing thename of pc and then next to it thename of user.
But I have no clue how to extract just the name past the domainname\
and the domainname\ is a static name and doesnt change in digits.

I know you guys have a clue on how I can do this if you could help me
thanks so much...

once I am done, i will post entire program here for others to benefit!
thank you
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin