Finding Computer name
#1
Scooby Regular
Thread Starter
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
"Your computer name is XXXXXX"
Thanks
Andy
#2
Scooby Senior
Join Date: Oct 2000
Location: Zurich, Switzerland
Posts: 3,105
Likes: 0
Received 0 Likes
on
0 Posts
'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
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
#3
Scooby Regular
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.
Steve.
#4
Scooby Regular
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
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.
<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.
#5
Scooby Regular
Thread Starter
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
Andy
#6
Scooby Regular
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
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
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
Trending Topics
#11
Scooby Regular
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]
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]
#12
Scooby Regular
Thread Starter
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
The only way i can do it at the moment is to send the html file to them by email
Andy
#13
Scooby Regular
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
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
Thread
Thread Starter
Forum
Replies
Last Post
Sam Witwicky
Engine Management and ECU Remapping
17
13 November 2015 10:49 AM