Is there a way to get Windows login username?

Reply

Join Date: Jul 2007
Posts: 19
Reputation: mohammadalipak is an unknown quantity at this point 
Solved Threads: 0
mohammadalipak mohammadalipak is offline Offline
Newbie Poster

Is there a way to get Windows login username?

 
0
  #1
Aug 21st, 2007
I'm logging employees' internet access for compliance with company policy. As soon as an employee visits a blocked site, he is redirected to a warning page (on the intranet). This warning page gets their IP addresses & emails them to the IT department. I also need their usernames.I have found 3 different solutions which all work from //localhost/ (when the page is run from the client's PC). However, this warning page will be on the intranet & I need to know whether it would work from the intranet or not? Or what modifications do I need to make? Here are the 3 ways:
1. ASP
  1. <%
  2. Response.Write Request.ServerVariables("LOGON_USER")
  3. %>
2. VBScript
  1. <SCRIPT LANGUAGE="VBScript">
  2. Dim objNet
  3. On Error Resume Next 'If fail to create object then display error
  4. ' (press no message)
  5. Set objNet = CreateObject("WScript.NetWork")
  6. If Err.Number <> 0 Then 'If err
  7. MsgBox "Do not press ""No"" If your browser warns you."
  8. Document.Location = "info.html" 'Display document by placing name again
  9. End if
  10.  
  11. Dim strInfo
  12. strInfo = "User Name is " & objNet.UserName & vbCRLF & _
  13. "Computer Name is " & objNet.ComputerName & vbCRLF & _
  14. "Domain Name is " & objNet.UserDomain
  15. MsgBox strInfo
  16.  
  17. document.write(strInfo)
  18.  
  19. Set objNet = Nothing 'Destroy the Object
  20. </SCRIPT>
3. Reading a File from employee's PC

Is there a way to read a file from employees' PC from the intranet - without them knowing?

Thank a lot in advance.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 1,765
Reputation: DimaYasny will become famous soon enough DimaYasny will become famous soon enough 
Solved Threads: 85
Moderator
Featured Poster
DimaYasny DimaYasny is offline Offline
Posting Virtuoso

Re: Is there a way to get Windows login username?

 
0
  #2
Aug 26th, 2007
Originally Posted by mohammadalipak View Post
Is there a way to read a file from employees' PC from the intranet - without them knowing?

Thank a lot in advance.
if you have administrator access there is.
Real stupidity always beats Artificial Intelligence. (Terry Pratchett)

BA BizMg, MCSE, DCSE, Linux+, Network+
Reply With Quote Quick reply to this message  
Join Date: Apr 2007
Posts: 1,120
Reputation: cguan_77 has a little shameless behaviour in the past 
Solved Threads: 93
cguan_77's Avatar
cguan_77 cguan_77 is offline Offline
Veteran Poster

Re: Is there a way to get Windows login username?

 
0
  #3
Oct 6th, 2007
hi, dimaYasny is right..you should have an adminsitrator account to do this..but i think it's against the odds..reading files of other users without their permissions..once they know about this, they will screwed you up...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Network Security
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC