Ask a Question related to ASP Database, Design and Development.
-
Enigma Webmaster #1
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
Enigma Webmaster Guest
-
XML assistance required
Simple xml problem: I need 8 text input fields into which the user will input statistics (numbers), the user will hit the SAVE button and the values... -
ADSI with PHP
Hi everyone, I'm pretty new to using the COM functionality in PHP. I want to administer my PC using PHP together with ADSI. My first problem is... -
ADSI
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... -
ASP, ADSI and IIS 6.0 Problem
Hi - I wrote an ASP script that adds users to Active Directory. I have been running this script sucessfully on Windows 2000 with IIS 5.0 for a... -
ADSI question
Hello, I use the following ASP code to access Active Directory's property: Dim objUser Set objUser = GetObject("WinNT://myDomain/UserId") I... -
Paweł Janowski #2
Re: ADSI - ASP Assistance Required.
U must Trust this computer in AD structure.
[url]http://www.serverwatch.com/tutorials/article.php/1478231[/url]
--
-------
Pawel Janowski
[url]http://www.sunrise-tm.com/os_janowski.aspx[/url]
Paweł Janowski Guest
-
Dave Navarro #3
Re: ADSI - ASP Assistance Required.
In article <QBbPc.490$yt5.30@newsfe2-gui.ntli.net>, [email]info@enigma-one.com[/email]
says...For some bizarre reason, in ASP you can only run ADSI code if you are> 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.
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.
Dave Navarro Guest



Reply With Quote

