Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How To Get Username and Domain Name in Windows 2003?

2 views
Skip to first unread message

Will

unread,
Jun 10, 2005, 8:03:13 PM6/10/05
to
Under Windows 2000, a batch file or VB program can use environment variables
UserName and UserDomain to get informal credentials of the current logged on
user. Under Windows 2003, these environment variables do not appear to
exist. What is the approved method for obtaining this information under
Windows 2003?

--
Will
Internet: westes AT earthbroadcast.com

Jeff Cochran

unread,
Jun 11, 2005, 10:07:06 AM6/11/05
to
On Fri, 10 Jun 2005 17:03:13 -0700, "Will"
<DELETE...@earthbroadcast.com> wrote:

>Under Windows 2000, a batch file or VB program can use environment variables
>UserName and UserDomain to get informal credentials of the current logged on
>user. Under Windows 2003, these environment variables do not appear to
>exist. What is the approved method for obtaining this information under
>Windows 2003?

How would you like to? :)

A common method is to use the WSH Network Object:

http://www.devguru.com/Technologies/wsh/quickref/wshnetwork.html

Jeff

Roger Abell

unread,
Jun 13, 2005, 3:34:08 AM6/13/05
to
??? ! ?
Those env vars exist for me !!

--
Roger Abell
Microsoft MVP (Windows Security)

"Will" <DELETE...@earthbroadcast.com> wrote in message
news:%23s$irjhbF...@TK2MSFTNGP09.phx.gbl...

Will

unread,
Jun 13, 2005, 7:14:49 PM6/13/05
to
Interesting, I wonder what happened to turn mine off under just Windows
2003.

--
Will
Internet: westes AT earthbroadcast.com


"Roger Abell" <mvpN...@asu.edu> wrote in message
news:OvIQIp#bFHA...@TK2MSFTNGP12.phx.gbl...

Roger Abell

unread,
Jun 14, 2005, 11:22:36 AM6/14/05
to
Yes, indeed.
I am unsure how you are attempting access to the env vars, but are
you sure you are accessing the system vars instead of only the user
env vars? If you open a cmd prompt and enter "set" do they not
show as set with expected values ?

--
Roger Abell
Microsoft MVP (Windows Security)

"Will" <DELETE...@earthbroadcast.com> wrote in message
news:4_mdnakcPd3...@giganews.com...

Will

unread,
Jun 14, 2005, 7:56:01 PM6/14/05
to
Correct they are absent from the command line response to the SET command.

--
Will
Internet: westes AT earthbroadcast.com


"Roger Abell" <mvpN...@asu.edu> wrote in message

news:e3RzgTPc...@TK2MSFTNGP09.phx.gbl...

Roger Abell

unread,
Jun 16, 2005, 1:35:38 AM6/16/05
to
Stumped Will. They must be set somewhere in the chain
when init starts up the user station processes, and perhaps it
is not firing due to some permission tweaking that prevents,
but I have never seen or heard of this before and would have
to really dig in to maybe figure what/where.

Hopefully someone else picks up on this thread with an idea !!

--
Roger Abell
Microsoft MVP (Windows Security)

"Will" <DELETE...@earthbroadcast.com> wrote in message
news:0uadnV3WP9T...@giganews.com...

0 new messages