Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Finding Computer name

Thread Tools
 
Search this Thread
 
Old 13 February 2002, 08:56 AM
  #1  
Avi
Scooby Regular
Thread Starter
 
Avi's Avatar
 
Join Date: Apr 2001
Location: Manchester
Posts: 5,084
Likes: 0
Received 0 Likes on 0 Posts
Post

can anyone suggest an easy way of finding a users computer name, what i'm really after is a url i can send them that will come up with

"Your computer name is XXXXXX"

Thanks

Andy
Old 13 February 2002, 11:05 AM
  #2  
dowser
Scooby Senior
 
dowser's Avatar
 
Join Date: Oct 2000
Location: Zurich, Switzerland
Posts: 3,105
Likes: 0
Received 0 Likes on 0 Posts
Post

'hostname' from a cmd prompt for local machine

nbtstat -A <ip-address> for a remote device.

For DNS names of hosts on the internet use 'nslookup' - web based ones are available. 'tracert' if you don't know the dns authorative for the domain the host is in.

You know that NetBIOS names and DNS names don't have to be the same?

Richard
Old 13 February 2002, 02:16 PM
  #3  
stevencotton
Scooby Regular
 
stevencotton's Avatar
 
Join Date: Jan 2001
Location: behind twin turbos
Posts: 2,710
Likes: 0
Received 1 Like on 1 Post
Post

You want to do this with CGI/SSI. Check your SSI implementation, failing that if you go the CGI route there should be a library/module you can use with your language that provides those functions.

Steve.
Old 13 February 2002, 06:00 PM
  #4  
David_Wallis
Scooby Regular
 
David_Wallis's Avatar
 
Join Date: Nov 2001
Location: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Posts: 15,239
Likes: 0
Received 1 Like on 1 Post
Post

Could use the following... applogies in advance for the bbs messing formatting up..

<HTML>
<HEAD> <TITLE>User Info</TITLE>
<Script Language="VBScript">
Dim objNetWork, StrInformation
On Error Resume Next
Set objNetWork = CreateObject("WScript.NetWork")
strInformation = "User Name:" & objNetWork.UserName & vbCRLF & "Computer Name is " & objNetWork.ComputerName & vbCRLF & "Domain Name is " & objNetWork.UserDomain
MsgBox strInformation
Set objNet = Nothing
</Script>
</HEAD>
</HTML>

David.
Old 14 February 2002, 09:43 AM
  #5  
Avi
Scooby Regular
Thread Starter
 
Avi's Avatar
 
Join Date: Apr 2001
Location: Manchester
Posts: 5,084
Likes: 0
Received 0 Likes on 0 Posts
Post

Thanks David - That's exactly the thing!!, I can only get it work by sending the user the html file and them running it locally, any ideas why I can't get it to work on an INTRANET or run it from a server??
Andy
Old 14 February 2002, 10:42 AM
  #6  
David_Wallis
Scooby Regular
 
David_Wallis's Avatar
 
Join Date: Nov 2001
Location: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Posts: 15,239
Likes: 0
Received 1 Like on 1 Post
Post

pass... havent got a clue, it should work as far as I know.. you may need to put runat=client... unsure of syntax, its been a while!

What we have is similar to that but it is a vbs file and the login script copies it to the current users profile, so that it sits at the top of the start menu... let me know if this is anyuse?

David
Old 14 February 2002, 10:52 AM
  #7  
dowser
Scooby Senior
 
dowser's Avatar
 
Join Date: Oct 2000
Location: Zurich, Switzerland
Posts: 3,105
Likes: 0
Received 0 Likes on 0 Posts
Post

Nice - if you get it working, please let me know

Thanks
Richard
Old 14 February 2002, 11:41 AM
  #8  
Avi
Scooby Regular
Thread Starter
 
Avi's Avatar
 
Join Date: Apr 2001
Location: Manchester
Posts: 5,084
Likes: 0
Received 0 Likes on 0 Posts
Post

The login script idea is a great one, that's just what i'm after
Old 14 February 2002, 01:08 PM
  #9  
Miles
Scooby Regular
 
Miles's Avatar
 
Join Date: Oct 1998
Location: The Granite City/Dallas, Tx.
Posts: 2,519
Likes: 0
Received 0 Likes on 0 Posts
Post

From a NT/2000 command prompt - ipconfig /all?
Old 14 February 2002, 01:23 PM
  #10  
Avi
Scooby Regular
Thread Starter
 
Avi's Avatar
 
Join Date: Apr 2001
Location: Manchester
Posts: 5,084
Likes: 0
Received 0 Likes on 0 Posts
Post

You obviously don't know my users

Old 14 February 2002, 02:39 PM
  #11  
ozzy
Scooby Regular
 
ozzy's Avatar
 
Join Date: Nov 1999
Location: Scotland, UK
Posts: 10,504
Likes: 0
Received 1 Like on 1 Post
Thumbs up

Andy,

If you create a file with a .vbs extension and this code, you can run it from inside their login script. It will create the shortcut on their Start Menu for you. Change the shortcut, path and filename to match where you store the script that generates the user info dialog box.

Dim objShell, strPath, objShortcut
Set objShell = WScript.CreateObject( _
"WScript.Shell" )
strPath = objShell.SpecialFolders( _
"StartMenu" )
Set objShortcut = objShell.CreateShortcut( _
strPath & "\LoginInfo.lnk" )
strAcc = "C:\"
objShortcut.TargetPath = strAcc & _
"test.vbs"
objShortcut.WindowStyle = 4
objShortcut.Save

As already mentioned, here's the code for the user info. Again, just save as a .vbs file to run it.

Dim objNetWork, StrInformation
On Error Resume Next
Set objNetWork = CreateObject("WScript.NetWork")
strInformation = "User Name is " & objNetWork.UserName & vbCRLF & "Computer Name is " & objNetWork.ComputerName & vbCRLF & "Domain Name is " & objNetWork.UserDomain
MsgBox strInformation
Set objNet = Nothing

David,

This VB scripting's got me all excited. What other variables can you use? Can you generate stuff from ipconfig ?

Ideally, I'd like to generate a user-specific file (say username.txt) with all their info inside - ip address, workstation name, etc..

If there's reference material I should be ready, please let me know.

Stefan

[Edited by ozzy - 2/14/2002 2:42:44 PM]
Old 14 February 2002, 05:01 PM
  #12  
Avi
Scooby Regular
Thread Starter
 
Avi's Avatar
 
Join Date: Apr 2001
Location: Manchester
Posts: 5,084
Likes: 0
Received 0 Likes on 0 Posts
Post

I can run these scripts locally fine, but I can't get them to run over the intranet or from a server.can anyone suggest why? What I'm after is a button on our intranet saying "Click to find your computer name "

The only way i can do it at the moment is to send the html file to them by email



Andy
Old 15 February 2002, 09:33 AM
  #13  
ozzy
Scooby Regular
 
ozzy's Avatar
 
Join Date: Nov 1999
Location: Scotland, UK
Posts: 10,504
Likes: 0
Received 1 Like on 1 Post
Post

Andy,

You say it won't work from the Intranet server - in what way?? Doesn't it launch or do you get some error ?

I created a simple page using Frontpage with a hover button that simply called the .html file containing the code. I haven't tried setting it up on our Intranet server here.

What server are you running? IIS?, Apache?

Stefan
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Sam Witwicky
Engine Management and ECU Remapping
17
13 November 2015 10:49 AM
TylerD529
General Technical
2
09 October 2015 01:53 AM
blackieblob
ScoobyNet General
2
02 October 2015 05:34 PM
makkink
General Technical
10
01 October 2015 05:41 PM
Wish
Computer & Technology Related
3
30 September 2015 10:39 PM



Quick Reply: Finding Computer name



All times are GMT +1. The time now is 02:53 PM.