dmbuso,
Here is some Console code to grab all the users in the Administrators group
and display their name and SID. You can change the group name in the code.
Code:
Imports System.Security.Principal
Imports System.DirectoryServices
Module Module1
Sub Main()
Dim localMachine As New DirectoryEntry("WinNT://" &
Environment.MachineName)
Dim admGroup As DirectoryEntry =
localMachine.Children.Find("administrators", "group")
Dim members As Object = admGroup.Invoke("members", Nothing)
For Each groupMember As Object In CType(members, IEnumerable)
Dim member As New DirectoryEntry(groupMember)
Console.WriteLine(member.Name)
Dim si As New
SecurityIdentifier(CType(member.Properties("object Sid")(0), Byte()), 0)
Dim sid As String = si.Value
Console.WriteLine(sid)
Next
Console.ReadLine()
End Sub
End Module
Hope this helps,
Steve
"dmbuso" <dm*****@community.nospamwrote in message
news:14**********************************@microsof t.com...
>I would like a listing of all users in the current domain (or on my
computer). I'm running Windows XP Home Edition and I've set up four user,
one
for each member of my family.
'My.User.Name' just lists me. How do I get the others? I looked at some
code
posted here on 4/27/07 and it doesn't work, I've already tried it.
Thanks in advance.
--
Dave B.