Use either WMI or ADSI
Watch out for Line Wraps
WMI Sample(C#.Net)
---
void DisplayUsers()
{
ManagementClass mc = new
ManagementClass("Win32_UserAccount");
ManagementObjectCollection moc =
mc.GetInstances();
foreach(ManagementObject mo in moc)
{
try
{
Console.WriteLine
("");
Console.WriteLine
("------------------------------------");
if (mo.Properties
["Domain"].Value.ToString().ToUpper()=="SSBATHENA")
{
Console.WriteLine("");
}
Console.WriteLine
(mo.Properties["Domain"].Value );
Console.WriteLine
(mo.Properties["Name"].Value );
Console.WriteLine
(mo.Properties["FullName"].Value );
Console.WriteLine
(mo.Properties["Status"].Value );
Console.WriteLine
("------------------------------------");
Console.WriteLine
("");
}
catch(Exception
p_objException)
{
Console.WriteLine
(p_objException.Message);
}
}
}
ADSI(VB.Net)
----
sub PullAllUsers(strDomain)
Dim Computer
Dim User
Set Computer = GetObject("WinNT://" & strDomain)
Computer.Filter = Array("User")
For Each User in Computer
Response.Write User.Name
Next
End Sub
hth
regards,
sr