Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

User Account Information in vb.net

Posted on 2011-02-23
4
Medium Priority
?
520 Views
Last Modified: 2013-12-07
How to get user accounts information i.e. user name, password,domain,groups (whether administratiors or others,etc.)
of the computer using vb.net

please help, its very urgent...
0
Comment
Question by:gopalhazel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 2000 total points
ID: 34967719
Retrieving password of windows: luckily not possible :)

With AD:
*  you can use WindowsPrincipal.IsInRole() to check if the user belongs to a specific group:
    http://msdn.microsoft.com/en-us/library/fs485fwh.aspx
*  http://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.userprincipal.getauthorizationgroups.aspx

Retrieve current Windows user information using VB.NET
http://www.techrepublic.com/article/retrieve-current-windows-user-information-using-vbnet/6115410


Working with Active Directory in VB.NET
http://www.codeproject.com/KB/system/active_directory_in_vbnet.aspx
0
 

Author Comment

by:gopalhazel
ID: 34968803
can anubody give me the sample code or example to get the user accounts information of the computer using vb.net..
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 34968831
Get Current Username in VB.NET
http://www.developerfusion.com/code/4409/get-current-username-in-vbnet/
Declare Function GetUserName Lib "advapi32.dll" Alias _ 
       "GetUserNameA" (ByVal lpBuffer As String, _ 
       ByRef nSize As Integer) As Integer 

   Public Function GetUserName() As String 
       Dim iReturn As Integer 
       Dim userName As String 
       userName = New String(CChar(" "), 50) 
       iReturn = GetUserName(userName, 50) 
       GetUserName = userName.Substring(0, userName.IndexOf(Chr(0))) 
   End Function

Open in new window

0
 
LVL 53

Expert Comment

by:Dhaest
ID: 34968835
Get the current user's name in Visual Basic .NET
http://www.vb-helper.com/howto_net_get_user_name.html
Private Sub Form1_Load(ByVal sender As System.Object, ByVal _
    e As System.EventArgs) Handles MyBase.Load
    lblUserName.Text = SystemInformation.UserName
End Sub

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Viewers will learn how to turn a Live Set into a compressed Live Pack file, and how to install Live Packs. Make: File > Collect All And Save: File > Manage Files: Click Manage Project: Click Create Pack: Select save location: Install: Doub…
Viewers will learn key ranges in Sampler to make their sampled instruments sound more realistic Gather samples of various notes and drag them to Key Range panel: Set proper root key for each sample: Select all the samples with Command-A (or Ctrl…

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question