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 Feb 13, 2002 | 08:56 AM
  #1  
Avi's Avatar
Avi
Thread Starter
Scooby Regular
 
Joined: Apr 2001
Posts: 5,084
Likes: 0
From: Manchester
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
Reply
Old Feb 13, 2002 | 11:05 AM
  #2  
dowser's Avatar
dowser
Scooby Senior
20 Year Member
 
Joined: Oct 2000
Posts: 3,105
Likes: 0
From: Zurich, Switzerland
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
Reply
Old Feb 13, 2002 | 02:16 PM
  #3  
stevencotton's Avatar
stevencotton
Scooby Regular
 
Joined: Jan 2001
Posts: 2,710
Likes: 1
From: behind twin turbos
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.
Reply
Old Feb 13, 2002 | 06:00 PM
  #4  
David_Wallis's Avatar
David_Wallis
Scooby Regular
 
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
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.
Reply
Old Feb 14, 2002 | 09:43 AM
  #5  
Avi's Avatar
Avi
Thread Starter
Scooby Regular
 
Joined: Apr 2001
Posts: 5,084
Likes: 0
From: Manchester
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
Reply
Old Feb 14, 2002 | 10:42 AM
  #6  
David_Wallis's Avatar
David_Wallis
Scooby Regular
 
Joined: Nov 2001
Posts: 15,239
Likes: 1
From: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
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
Reply
Old Feb 14, 2002 | 10:52 AM
  #7  
dowser's Avatar
dowser
Scooby Senior
20 Year Member
 
Joined: Oct 2000
Posts: 3,105
Likes: 0
From: Zurich, Switzerland
Post

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

Thanks
Richard
Reply
Old Feb 14, 2002 | 11:41 AM
  #8  
Avi's Avatar
Avi
Thread Starter
Scooby Regular
 
Joined: Apr 2001
Posts: 5,084
Likes: 0
From: Manchester
Post

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

From a NT/2000 command prompt - ipconfig /all?
Reply
Old Feb 14, 2002 | 01:23 PM
  #10  
Avi's Avatar
Avi
Thread Starter
Scooby Regular
 
Joined: Apr 2001
Posts: 5,084
Likes: 0
From: Manchester
Post

You obviously don't know my users

Reply
Old Feb 14, 2002 | 02:39 PM
  #11  
ozzy's Avatar
ozzy
Scooby Regular
 
Joined: Nov 1999
Posts: 10,504
Likes: 1
From: Scotland, UK
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]
Reply
Old Feb 14, 2002 | 05:01 PM
  #12  
Avi's Avatar
Avi
Thread Starter
Scooby Regular
 
Joined: Apr 2001
Posts: 5,084
Likes: 0
From: Manchester
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
Reply
Old Feb 15, 2002 | 09:33 AM
  #13  
ozzy's Avatar
ozzy
Scooby Regular
 
Joined: Nov 1999
Posts: 10,504
Likes: 1
From: Scotland, UK
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
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Sam Witwicky
Engine Management and ECU Remapping
17
Nov 13, 2015 10:49 AM
TylerD529
General Technical
2
Oct 9, 2015 01:53 AM
blackieblob
ScoobyNet General
2
Oct 2, 2015 05:34 PM
makkink
General Technical
10
Oct 1, 2015 05:41 PM
Wish
Computer & Technology Related
3
Sep 30, 2015 10:39 PM




All times are GMT +1. The time now is 12:44 PM.