Function basADSILogin(vDomain,vUser,vPwd) Dim vADsPath vADsPath = "WinNT://" & vDomain & "/" & vUser & ",user"
Dim objADSI
basADSILogin = False
On Error Resume Next
Set objADSI = GetObject(vADsPath)
If Err.number <> 0 Then Exit Function
Dim objADSINamespace : Set objADSINamespace = GetObject("WinNT:")
On Error Resume Next
Set objADSI = objADSINamespace.OpenDSObject(vADsPath,vUser,vPwd,0)
If Err.number = 0 Then
basADSILogin = True
End If
Set objADSI = Nothing
Set objADSINamespace = Nothing
End Function