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

<%
Response.Write Request.ServerVariables("LOGON_USER")
%>

2. VBScript

<SCRIPT LANGUAGE="VBScript">
Dim objNet
On Error Resume Next 'If fail to create object then display error
' (press no message)
Set objNet = CreateObject("WScript.NetWork")
If Err.Number <> 0 Then 'If err
MsgBox "Do not press ""No"" If your browser warns you."
Document.Location = "info.html" 'Display document by placing name again
End if

Dim strInfo
strInfo = "User Name is " & objNet.UserName & vbCRLF & _
"Computer Name is " & objNet.ComputerName & vbCRLF & _
"Domain Name is " & objNet.UserDomain
MsgBox strInfo

document.write(strInfo)

Set objNet = Nothing 'Destroy the Object
</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.

Dani AI

Generated

Quick answer / practical path: client-side tricks (VBScript / WScript) only reliably work on the local machine (file:// or localhost) and are blocked or prompt on real intranet pages; the robust, supported way is to use server-side Integrated Windows Authentication (IWA) or an authenticating proxy so the server/proxy receives the username and logs it. This matches ’s observation that things “work on localhost” and / ’s point about requiring administrative control — you need server/proxy and AD-level configuration, not a stealth client-side read. (stackoverflow.com)

Quick checklist to get usernames from intranet traffic (no client prompts when configured correctly)

  • Server: install/enable the IIS Windows Authentication feature and disable Anonymous Authentication for the intranet site or app. That makes the browser send the logged-in domain account to the server. (learn.microsoft.com)

  • Client/browser: ensure the intranet URL is treated as “Local intranet” (IE/Edge) or configure Chrome/Firefox policies so browsers automatically send credentials to that host. Without that, browsers will prompt or block automatic logon. (learn.microsoft.com)

  • Kerberos / SPN: if you want Kerberos (Negotiate) instead of NTLM, register the HTTP SPN in AD for the service account running the site — for example:

    setspn -S HTTP/www.example.local DOMAIN\svcAccount

    This prevents fallbacks and authentication failures. (learn.microsoft.com)

  • Testing on the server: if you browse the site from the server using an FQDN/host header you may hit the loopback check issue; follow Microsoft’s KB guidance (BackConnectionHostNames / DisableLoopbackCheck) rather than disabling protections blindly. (ftp.zx.net.nz)

If you can’t change the web server, put an authenticating proxy (NTLM/Negotiate) in front of the traffic and log proxy.authenticated_user — common in enterprise (Squid + ntlm_auth or commercial appliances). (wiki.squid-cache.org)

Important: do not attempt to read files from employees’ PCs “without them knowing.” Unauthorized access raises serious legal and policy issues; check corporate policy and applicable law before collecting user-identifying data. (congress.gov)

This gives the reliable, auditable approaches that scale across an intranet; more specific steps (IIS version differences, SPN examples, GPO entries for browser whitelists) can be posted if the server OS, IIS version and browser mix are provided.

Recommended Answers

All 2 Replies

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.

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...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.