Solved

User Account Information in vb.net

Posted on 2011-02-23
4
516 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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
New to live audio mixing? Member of a band who wants to improve the quality of your bands sound? Need to brush up on mixing techniques? Sick of subpar mixes? This is the article for you!
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 how to include realistic velocity sensitivity to their Sampler instruments. Set the Vol<Vel parameter in the Filter/Global tab to your desired setting: Gather samples of hits of various intensity, and drag/drop into Velocity zon…

728 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