I am trying to impersonate user from ASP with the following method . I am able to do that with VB but not from asp.<BR>Can anyone help me out !!<BR><BR>I created a dll(LoggingUser) with the following modules <BR><BR>ImpersonateUser Class<BR>**********************<BR>Option Explicit<BR> Private Const LOGON32_LOGON_INTERACTIVE = 2<BR> Private Const LOGON32_PROVIDER_DEFAULT = 0<BR> <BR> Public Function Logon(ByVal strAdminUser As String, ByVal strAdminPassword As String, ByVal strAdminDomain As String) As Boolean<BR><BR> Dim lngTokenHandle, lngLogonType, lngLogonProvider As Long<BR> Dim blnResult As Boolean<BR> <BR> lngLogonType = LOGON32_LOGON_INTERACTIVE<BR> lngLogonProvider = LOGON32_PROVIDER_DEFAULT<BR> <BR> blnResult = RevertToSelf()<BR> <BR> blnResult = LogonUser(strAdminUser, strAdminDomain, strAdminPassword, _<BR> lngLogonType, lngLogonProvider, _<BR> lngTokenHandle)<BR> <BR> blnResult = ImpersonateLoggedOnUser(lngTokenHandle)<BR> <BR> Logon = blnResult<BR> <BR> End Function<BR><BR> Public Function Logoff()<BR> Dim blnResult As Boolean<BR> <BR> blnResult = RevertToSelf()<BR> Logoff = blnResult<BR> End Function<BR><BR>LogonAPIs.BAS<BR>*************<BR> Option Explicit<BR><BR>Public Declare Function LogonUser Lib "advapi32.dll" _<BR>Alias "LogonUserA" (ByVal lpszUsername As String, _<BR>ByVal lpszDomain As String, ByVal lpszPassword As String, _<BR>ByVal dwLogonType As Long, ByVal dwLogonProvider As Long, _<BR>phToken As Long) As Long<BR><BR>Public Declare Function ImpersonateLoggedOnUser Lib "advapi32.dll" (ByVal hToken As Long) As Long<BR><BR>Public Declare Function RevertToSelf Lib "advapi32.dll" () As Long<BR>&#039;************************************ **************************<BR><BR>I am calling the method from<BR>Logon.ASP<BR>*********<BR><BR>dim objLogon,blnResult<BR><BR>set objLogon = server.CreateObject("logginguser.impersonateuser") <BR><BR>blnResult=objLogon.Logon("user1", "password1", "REPLICASE")<BR><BR>if blnResult then<BR> Response.Write "successful"<BR>else<BR> Response.Write "Not Successful"<BR>end if<BR>objLogon.Logoff()<BR>set objLogon = nothing<BR><BR><BR>I always get Not Successful !!!