By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,582 Members | 1,720 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,582 IT Pros & Developers. It's quick & easy.

windows user account

P: n/a
Dear all...

Does anyone know how to get a list of windows user accounts? With
Principal.WindowsIdentity.GetCurrent.Name, we can get the name of the
current user. How can I get the other user's name which is logged off?

Many thanks..

--
weifuk - forum member
http://www.visual-basic-data-mining.net/forum
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi,

dim string as usernow = environtment.username

I hope this helps?

Cor
Nov 21 '05 #2

P: n/a
Hi,

' Add a Reference to System.Management

Dim moReturn As Management.ManagementObjectCollection

Dim moSearch As Management.ManagementObjectSearcher

Dim mo As Management.ManagementObject

moSearch = New Management.ManagementObjectSearcher("Select * from
Win32_UserAccount")

moReturn = moSearch.Get

For Each mo In moReturn

Trace.WriteLine(String.Format("{0} Domain {1}", mo("Name"), mo("Domain")))

Next

Ken

-----------------------------

"http://www.visual-basic-data-mining.net/forum" <si******@gmail.com> wrote
in message news:Ok**************@TK2MSFTNGP09.phx.gbl...
Dear all...

Does anyone know how to get a list of windows user accounts? With
Principal.WindowsIdentity.GetCurrent.Name, we can get the name of the
current user. How can I get the other user's name which is logged off?

Many thanks..

--
weifuk - forum member
http://www.visual-basic-data-mining.net/forum

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.