Getting NT User Name in VBScript 
Author Message
 Getting NT User Name in VBScript

I have seen this example (& similar ones) posted here several times:

Set oNet = CreateObject("WScript.Network")
name=oNet.username

Will this only work on an NT client PC?  I get errors trying to test this
using Win98.  Also, the clients will not be logged into the server where the
ASP application resides.  Will this vbscirpt code still work in that
instance?  Is this a client-side object?

Thanks very much!

--

David Knight
RoundTable Technology Solutions



Wed, 27 Aug 2003 03:15:04 GMT  
 Getting NT User Name in VBScript

Quote:
> I have seen this example (& similar ones) posted here several times:

> Set oNet = CreateObject("WScript.Network")
> name=oNet.username

> Will this only work on an NT client PC?  I get errors trying to test this
> using Win98.  Also, the clients will not be logged into the server where
the
> ASP application resides.  Will this vbscirpt code still work in that
> instance?  Is this a client-side object?

I've used this once on a Win98 machine.
I am fairly certain it has to be client-side and
that the machine should be hooked up to a network.

--
Ryan Flynn
Practical web development/design
www.ryanflynn.com



Wed, 27 Aug 2003 06:56:31 GMT  
 Getting NT User Name in VBScript
You can't get the username server side unless you use authentication (anything but anonymous) on the
site.  In that case Request.ServerVariables("AUTH_USER") and also "LOGON_USER" will give you this
information...

ServerVariables
http://msdn.microsoft.com/library/psdk/iisref/vbob5vsj.htm

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--

Quote:

> I have seen this example (& similar ones) posted here several times:

> Set oNet = CreateObject("WScript.Network")
> name=oNet.username

> Will this only work on an NT client PC?  I get errors trying to test this
> using Win98.  Also, the clients will not be logged into the server where the
> ASP application resides.  Will this vbscirpt code still work in that
> instance?  Is this a client-side object?

> Thanks very much!

> --

> David Knight
> RoundTable Technology Solutions




Wed, 27 Aug 2003 13:02:45 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting NT User Login Name

2. Getting NT user name via browser

3. getting windows NT user name

4. Getting NT Users LOGIN NAME?

5. Getting user names on NT domain

6. getting NT user names

7. Getting the NT User Name

8. Getting user name during NT logon

9. Getting the full user name under Win NT

10. Getting the user's logon name and computer name

11. How can I read the USER NAME (Win NT) with VBScript

12. getting users name and workstation name Urgent

 

 
Powered by phpBB® Forum Software