windows user account

  • Thread starter Thread starter http://www.visual-basic-data-mining.net/forum
  • Start date Start date
H

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

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

dim string as usernow = environtment.username

I hope this helps?

Cor
 
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

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top