Check login and password with user db in win2k

SM0LF
09-20-2000, 07:16 AM
Hi i hope this is the right group :O)
To my problem - I need to check a login in my applikation with the user db on my server.
I have heard something about using NetUserEnum !
But i can't seem to find anything about it :O(

I do not need to get the username and password - just need to compare input with server, to see if the user is valid.

SM0LF

Flamelord
09-28-2000, 09:21 AM
If you only need the name try GetUserNameEx. If you want the password you would have to be in Windows 2000 and set the Local Security Policy to not encrypt password. Otherwise, you cannot get the password. There is no API for retreiving passwords.

SM0LF
09-29-2000, 08:44 AM
I do not need to get them for my application, i just wanna chek if the user has permission on the PDC (Domain) :O)

And i have found out how :

Option Explicit
Dim dsObject As IADsOpenDSObject
Dim dsDomain As IADsDomain
Dim vUser As String
Dim vPass As String

Private Sub cmdLogin_Click()
vUser = user.Text
vPass = pass.Text
Set dsObject = GetObject("WinNT:")
Set dsDomain = dsObject.OpenDSObject("WinNT://DitDomain", vUser, vPass, ADS_SECURE_AUTHENTICATION)
End Sub

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum