|
-
February 22nd, 2010, 08:59 AM
#1
How to get all user account info in C# (windows VISTA/7)??
Hey guys,
is there a way to get the information (username, home directory, user group, ...) from every user account on a windows machine (VISTA / 7). I'm running the program as an Administrator so rights shouldn't be a problem.
Ofcourse the passwords aren't needed.
Thanks in advance!!!
PS: I'm not that great of a programmer , so some example code would be sweet!
-
February 22nd, 2010, 09:03 AM
#2
Re: How to get all user account info in C# (windows VISTA/7)??
Because I can't seem to find an edit button I'll post this in another post:
I'm using visual studio 2008 so C#.net 3.5
-
February 22nd, 2010, 01:35 PM
#3
Re: How to get all user account info in C# (windows VISTA/7)??
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback  you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
-
February 22nd, 2010, 01:38 PM
#4
Re: How to get all user account info in C# (windows VISTA/7)??
thanks but I tried this and it says I don't have the valid namespace while I'm sure I do...
-
February 22nd, 2010, 01:44 PM
#5
Re: How to get all user account info in C# (windows VISTA/7)??
the compiler usually knows better so maybe show us your code?
win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming
remeber to give feedback  you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation
private lessons are not an option so please don't ask for help in private, I won't replay
if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know
-
February 22nd, 2010, 11:32 PM
#6
Re: How to get all user account info in C# (windows VISTA/7)??
I thinks you should add using System.Management;
and add reference System.Management to your project.
-
February 24th, 2010, 08:44 AM
#7
Re: How to get all user account info in C# (windows VISTA/7)??
 Originally Posted by memeloo
Thank you, this was amazing help and it worked.
I only now need to find how I can get a user's group, because that doesn't seem to be an option like "name" or "fullname" with WMI.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|