473,320 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ADSI - ASP Assistance Required.

Hi All,

We've written a couple of functions which, when run in VB6 work fine and
allow AD users to be updated. When we include the code into an ASP Page and
try and update a users information (i.e. Mobile Phone Number) we get a
failure as below...

Error Number:- -2147467259 Automation error Unspecified error

Can anyone see why this is happenning? Whe nwe run the DLL from VB6 or
Studio.NET then it works fine. We've checked the Security permissions on
the WebServer and it uses the Administrator Account.

Thanks in anticipation.

KMP

TEST HARNESS ASP PAGE
<html>

<%@ Language=VBScript %>
<%
dim myobj,retval
set myObj = createobject("TinopADutilityV2.ActiveDirectory")
retVal = myObj.ConnecttoLDAP("Username","Interactive") ' retVal = 1 if
successful, 0 otherwise
response.write(myObj.GetInfo("cn")) & "<br>" ' Display
Username to show we have right user
retVal = myObj.UpdateInfo("Mobile", "07990 123456") ' Update
Details. retVal = 1 if OK, otherwise -1
myobj.closeLDAP
%>
</html>
VB6 DLL SourceCode

VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "ActiveDirectory"
Attribute VB_GlobalNameSpace = True
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
'***************************************
'* *
'* ActiveX dll Developed to interact *
'* with Active Dirctory.... *
'* Created by E Strangler 31/7/2004*
'* *
'***************************************

Option Explicit
Dim objUserInfo As Object
Dim strLDAPAddress As String

Public Function ConnecttoLDAP(ByVal strDisName As Variant, ByVal strOrgUnit
As Variant) As Boolean

On Error GoTo errCleanUp

Set objUserInfo = GetObject("LDAP://CN=" & strDisName & ",OU=" &
strOrgUnit & ",DC=AgendaTV,DC=Co,DC=UK")
ConnecttoLDAP = True
Exit Function

errCleanUp:
'MsgBox ("An error has occurred. " & Err.Description)
ConnecttoLDAP = False

End Function

Public Function UpdateInfo(ByVal strFieldName As Variant, ByVal strData As
Variant) As Long

On Error GoTo Err_Handler

'Update with new data
objUserInfo.put strFieldName, strData

'Commit to the directory.
objUserInfo.SetInfo
UpdateInfo = 1
Exit Function

Err_Handler:

UpdateInfo = -1 'If execute fail then return -1

End Function

Public Function GetInfo(ByVal strFieldName As Variant) As Variant

'Returns data specified by the field name
GetInfo = objUserInfo.Get(strFieldName)

End Function

Public Function CloseLDAP() As Long

'Destroy object
Set objUserInfo = Nothing

End Function


Jul 19 '05 #1
2 2426
U must Trust this computer in AD structure.

http://www.serverwatch.com/tutorials...le.php/1478231

--
-------
Pawel Janowski
http://www.sunrise-tm.com/os_janowski.aspx
Jul 19 '05 #2
In article <QB**************@newsfe2-gui.ntli.net>, in**@enigma-one.com
says...
Hi All,

We've written a couple of functions which, when run in VB6 work fine and
allow AD users to be updated. When we include the code into an ASP Page and
try and update a users information (i.e. Mobile Phone Number) we get a
failure as below...

Error Number:- -2147467259 Automation error Unspecified error

Can anyone see why this is happenning? Whe nwe run the DLL from VB6 or
Studio.NET then it works fine. We've checked the Security permissions on
the WebServer and it uses the Administrator Account.


For some bizarre reason, in ASP you can only run ADSI code if you are
connected as an "authenticated user". Anonymous connections will not
create the necessary security level to run ADSI code.

I got around it by "calling" my ADSI code from an anonymous web page
using ServerXMLHTTP to do the authentication for me.

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Miguel Orrego | last post by:
Hi, I have found some code that authenticates users agains a domain using ADSI. I then redirect to another page and pass the username they have entered as a string. However, it would be nice to...
9
by: Sophia | last post by:
I need to authenticate users to enter in a NTLM-protected virtual directory, but I can't pop up a NT-login dialogue box - I can only do a web-based username/password form (my client is a...
4
by: Akhlaq Khan | last post by:
we are developing an intranet application (web based) which needs to detect the logged in user ID of the user hitting the website. the intranet is huge and based on win2k active directory (around...
1
by: Ryan Ritten | last post by:
I was wondering if anyone knew how (or if it's even possible) to cache the results of an ADSI call in asp for a longer period of time. Basically what I am doing is I have a website that loads the...
14
by: Arran Pearce | last post by:
Hi, I am looking for a way to use System.DirectoryServices to find all users on a domain whos accounts are either locked out or disabled. I have used ADSIEdit and the mmc schema add-in to try...
3
by: Roy Osherove | last post by:
Hi folks. I have an ASP.Net application that runs a .Net dll that uses WMI and ADSI(both managed) to connect to a given IIS root and search through it. When not using the ASP.Net client, but...
0
by: Mutley | last post by:
Hi, I am using ADSI in a c# application developed with Visual Studio.NET to programmatically add an application mapping into IIS for a custom handler. What security rights are required to add the...
3
by: chat_devil | last post by:
hi, does anyone know if it is possible to remove an attribute that can not be read into the ADSI property cache/collection. i'm trying to do an eDirectory password change from .net directory...
8
by: John | last post by:
Hi, gurus, How can I implement the following feature in C#: Set objGroup = GetObject("WinNT://" & strComputer & "/" & strGroup & ", group") For Each objMember In objGroup.Members...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.