Solved

User Account Information in vb.net

Posted on 2011-02-23
4
504 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
  • 3
4 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Viewers will learn the basics of making and using Impulse Kits in Ableton Live. Load new Impulse into an empty MIDI track: Fill the 8 empty sample slots with drum samples: Adjust parameters to tailor each sound as desired: Proceed to create be…
Viewers will learn how to use LFOs to modulate the sound of their Sampler instruments. Click the Modulation tab in Sampler: Choose one (or more) of the three available LFOs, and click the respective button to turn it on: Select a waveform, an LF…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now