-
Jan 19th, 2009, 05:18 AM
#1
Thread Starter
Junior Member
Help Needed Regarding ADS Library
hi there,
i am working with this script on my project.
Function AuthCheck(ByVal sUser As String, ByVal sPassword As String) As Boolean
On Error GoTo E
Dim RootDSE
Dim DSObject
Dim Auth
Dim NamingContext
Const ADS_SECURE_AUTHENTICATION = 1
Set RootDSE = GetObject("GC://DOMAIN/rootDSE")
NamingContext = RootDSE.Get("defaultNamingContext")
Set DSObject = GetObject("GC:")
Set Auth = DSObject.OpenDSObject("GC://" & NamingContext, sUser, sPassword, ADS_SECURE_AUTHENTICATION)
Set Auth = Nothing
Set DSObject = Nothing
Set RootDSE = Nothing
AuthCheck = True
Exit Function
E:
AuthCheck = False
' log the err.Description if needed
End Function
I want to use Domain Name by getting it through winntsysteminfo on runtime. this script works fine if domain name is hard-coded. Please Help.
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
|