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

List of valid users

P: n/a
If I am logged on as an administrator how can I get a list of user names
that can log on to this machine?
(and how do you guys find this kind of information?)

Thanks
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi,

You can use the wmi for that. 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_Account")

Debug.WriteLine("Accounts")

moReturn = moSearch.Get

For Each mo In moReturn

Try

Debug.WriteLine(mo("Name").ToString)

Catch

End Try

Next
Ken
-----------------------
"Jack Russell" <ja***@norubbish.tpg.com.au> wrote in message
news:u8**************@TK2MSFTNGP15.phx.gbl...
If I am logged on as an administrator how can I get a list of user names
that can log on to this machine?
(and how do you guys find this kind of information?)

Thanks
Nov 21 '05 #2

P: n/a
You can access active Directory

if it is that u want tell me to send u a sample
Doei!!
--
System Engineer
Visual Basic .NET
C#
SQL Server
And happy to learn any other thing :D
"Jack Russell" wrote:
If I am logged on as an administrator how can I get a list of user names
that can log on to this machine?
(and how do you guys find this kind of information?)

Thanks

Nov 21 '05 #3

P: n/a
Ken Tucker [MVP] wrote:
Hi,

You can use the wmi for that. 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_Account")

Debug.WriteLine("Accounts")

moReturn = moSearch.Get

For Each mo In moReturn

Try

Debug.WriteLine(mo("Name").ToString)

Catch

End Try

Next
Ken
-----------------------
"Jack Russell" <ja***@norubbish.tpg.com.au> wrote in message
news:u8**************@TK2MSFTNGP15.phx.gbl...
If I am logged on as an administrator how can I get a list of user names
that can log on to this machine?
(and how do you guys find this kind of information?)

Thanks

Many thanks, you did not answer the second part of my question!
Nov 21 '05 #4

P: n/a
Jack,

Using MSDN, however WMI information is hard to find, so take some time.

(your first search keyword is forever WMI)

I hope this helps something.

Cor
Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.