Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

possible script to identify ipaddress? 2

Status
Not open for further replies.

techwiggle

Technical User
Aug 18, 2009
3
US
here is in a nutshell what I'm trying to do:

I would like to have a script that will go out and check username to computername and output results with IPaddress of computername.

so like
1. I enter username of user in input box

2. that username should be compared (or mapped) to the computername for that user (usually includes username in part of computername)

3. need to either pass the computername info into a poup box or better yet the ipaddress of the computername into a popup box. (so there would be a ping reauest going on and the output would then be displayed in window)


the reason behind this is that I would like to have the ipaddress information so I don't have to ask the user for the IPaddress information (cuz half the time they don't know where to go) overall this should save some time.

any suggestions on how to go about it would be greatly appreciated.

 
You should actually look into LanSweeper. I use it for this. I put in the users name into the search field hit enter and it shows me properties regarding the user including the system they are currently logged into. I then just click the computer name link and then the VNC link and it opens a VNC session to the user's PC. I even created a batchfile that silently installs VNC and sets it to run as a system service.

The problem with your idea for the script is that it would first have to use WMI to query for the logged on user of every PC in you domain. This could cause a ton of network traffic. There is no way to really do this query in reverse that I am aware of.

Lansweeper has a client application that you set to run (invisible to the user) as a logon script. It works great for what you want.
 
Thanks for the suggestion Robert - I'd not come across that app before so I'm giving you a little purple star :)
 
this is great, Thanks a ton. and what I really like about the product is that is it one of best four letter words "FREE"!

I'd be interested in the batch for VNC install... [bigears]
 
Let me get them together and remove all the identifying info and document them a little and I will post them. They were really quick and dirty, so there are probably far better ways to accomplish what they do, but they work!
 
I am going to redo this to use powershell, but I have three batch files that I use. You will need PSExec for these to work. You will need to create the reg files from a machine that you have previously installed TigthVNC on already. These are documented on the TightVNC site. I use the pings just to waste time to be sure the action has completed. They may not be needed.

########## The 1st File #######

psexec \\computername -u domain\administrator -c K:\admin\remote_copy.cmd
psexec \\computername -u domain\administrator -c K:\admin\vnc_install.cmd
pause


######### The 2nd File ###############

mkdir C:\temp\
copy \\fileservername\apps\vnc\tightvnc-1.3.10-setup.exe C:\temp\tightvnc-1.3.10-setup.exe
copy \\fileservername\apps\vnc\vnc1.reg C:\temp\vnc1.reg
copy \\fileservername\apps\vnc\vnc2.reg C:\temp\vnc2.reg


######### The 3rd File ###############

C:\MWGTemp\tightvnc-1.3.10-setup.exe /sp- /verysilent
regedit /s C:\temp\vnc1.reg
regedit /s C:\temp\vnc2.reg
ping 192.168.1.254
ping 192.168.1.254

"C:\program files\TightVNC\WinVNC.exe" -install
ping 192.168.1.254
ping 192.168.1.254
ping 192.168.1.254
ping 192.168.1.254
ping 192.168.1.254
ping 192.168.1.254
ping 192.168.1.254
ping 192.168.1.254
net start "vnc server
 
This question seems to be answered to the OPs satisfaction, I just want to point out that in my login script FAQ I do give some code to record what computer a user is currently logged into. This requires a SQL database exist somewhere on your network, but it is a simple solution for recording logon and logoff conditions and would also serve the purpose of identifying which PC a user is currently logged into. 329-5798

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top