Domain users an other users

  • Thread starter Thread starter Juan Pedro Gonzalez
  • Start date Start date
J

Juan Pedro Gonzalez

Hi

I'm developping an application as a front end for SQL server. I want to use
System authentication on my SQL Server.

I want to be able to add new users accounts. The gretatest problem here is
to display a window with a list of users and or groups of my domain so the
administrator doesn't have to type the whole name. I'd also want to know how
this could be done if I'm inside a workgroup (No domain)... That is, getting
the users list from a remote machine.

Thanks in advance.
 
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

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

Debug.WriteLine("Groups")

moReturn = moSearch.Get

For Each mo In moReturn

Try

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

Catch

End Try

Next



Ken
 
Back
Top