Zutar Posted October 21, 2003 Posted October 21, 2003 Hi, I need to retrieve ALL windows users, whatever their group is. I had the code in VB6, Set myComputer = GetObject("WinNT://" & sComputerName & ",computer") If Err.Number <> 0 Then MsgBox ("An error has occurred." & Err.Number) Exit Sub End If myComputer.Filter = Array("user") For Each member In myComputer List1.AddItem member.Name Next But in VB.net its not working, well.. there is an error with the Array Function, being a type in vb.net. anyone have an idea how to do it? Many thanks Quote
AlexCode Posted October 21, 2003 Posted October 21, 2003 Maybe you may want do take a look at this NameSpace: System.DirectoryServices Quote Software bugs are impossible to detect by anybody except the end user.
Zutar Posted October 21, 2003 Author Posted October 21, 2003 Im not using AD, its only for a local machine. and more important.. the system.directoryservice does not exist. Quote
Administrators PlausiblyDamp Posted October 22, 2003 Administrators Posted October 22, 2003 You will need to add a reference to it before you can use it. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Zutar Posted October 22, 2003 Author Posted October 22, 2003 Is directoryservices can be used to use Win2k local users? If so, can someone post me a little example how to use it? I need to list, create and remove users from a local computer with my software. I had a working code on vb6, but I need to switch to .NET Quote
Administrators PlausiblyDamp Posted October 22, 2003 Administrators Posted October 22, 2003 It can be used with local accounts. IIRC you can use the same WINNT://name,computer syntax Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.