ActiveDs.DLL Woes


New member
Feb 6, 2008
Programming Experience

Sorry that my first post is a problem post but I've been working on this for awhile and I'm desperate to find someone that knows how to fix it :p.

I'm currently doing a project to get file permissions from folders using a
web interface. I'm using ASP.NET running VB.NET backend scripting on IIS 6.0
application server. I've been working on a web interface program for awhile
now and have set up pass through (impersonation) authentication. I have
completed several scripts that are fully integrated with my network, for
example I have one script that will change a users settings in active
directory via the web interface. Everything I have done has been successful
until this point.

I'm running a script that is calling ADsSecurityUtility to get the
permissions from my file server. I'm not using WINS because it's querying a
linux server. The script works fine as a normal VBScript and WAS working fine
as an .aspx script. It gets the permission via a text web text box and
displays them on a larger web text box based on whether they are read or
write. I'm using ActiveDS.DLL version and calling it as such: <%@
Import namespace="activeds" %>.

So the symptoms are that I will run the script from the web server, it will
run fine and will get the permissions on any file I wish to query. I will
walk away for a couple of minutes, log back into the computer running the web
server, try the web page and it will give me the following error:

Retrieving the COM class factory for component with CLSID
{F270C64A-FFB8-4AE4-85FE-3A75E5347966} failed due to the following error:

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Retrieving
the COM class factory for component with CLSID
{F270C64A-FFB8-4AE4-85FE-3A75E5347966} failed due to the following error:

Source Error:

Line 23: strabsolutefolderpath =
Line 24:
Line 25: AD = New activeds.ADsSecurityUtility
Line 26: adssecuritydescriptor =
AD.GetSecurityDescriptor(strabsolutefolderpath, ADS_PATH_FILE,
Line 27: odacl = adssecuritydescriptor.DiscretionaryACL
The error seems time dependent as I can log off, log back in, log off, log
back in as a new user, change whatever I want but then I'll leave it for
awhile and it will die on me only with time. I can also get it to
consistantly crash by restarting the server itself.

I've checked to ensure that this CLSID is related properly to ActiveDS.DLL
and it is related properly. I've also run RegSVR32 ACTIVEDS.DLL to ensure
that the DLL is registered properly and it comes back and says that the DLL
has been properly registered.

I've eliminated some of the causes as follows:

I initially thought that the DLL was corrupt but I have a known good
ActiveDS.DLL sitting on a seperate computers and I ran an MD5 hash against
both of them and they are the same.

I thought that, possibly, the DLL may be loaded into RAM and that the web
was running of RAM and when RAM was flushed for w/e reason the DLL was
removed, started using the DLL on hard disk which was, for whatever reason,
at that point corrupt. This cannot be the case as I hashed the DLL before it
stopped working and after and they're the same. Also, I replaced the DLL with
one I knew wouldn't work and I ran the programt, didn't work, then I replaced
the DLL with the one that should be working and it worked properly.

I thought maybe windows had the wrong DLL in the DLL cache and was replacing
the DLL in my web folder with the one in the DLL cache so I replaced the DLL
in DLL cache with the known good one and it still had the same problem.

Some observations that I've made along my way that MAY be leading to the
cause of this problem:

I've noticed that the DLL is not consistant through out the windows OS
meaning that its in many different places but different in said places. IE:
There's an ActiveDS.DLL in C:\windows\system32\ that's version 5.x.x.x but
the one I'm supposed to be running is . I'm thinking possibly a DLL
conflict? The activeDS.dll in windows /system32 is also 195kb compared to the
activeds.dll that I'm using, which is 104kb. I've tried replacing the
activeds.dll in my bin file with the one from windows/system32 which then
gives me the following error:
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vbc.exe" /t:library
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
/R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
/out:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
/D:DEBUG=1 /debug+ /define:_MYTYPE=\"Web\"
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET

Microsoft (R) Visual Basic Compiler version 8.0.50727.42
for Microsoft (R) .NET Framework version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
: warning BC40056: Namespace or type specified in the Imports 'activeds'
doesn't contain any public member or cannot be found. Make sure the namespace
or the type is defined and contains at least one public member. Make sure the
imported element name doesn't use any aliases.

Imports activeds
C:\Web\Permission_LookupV2(knowngood).aspx(5) : error BC30002: Type
'activeds.ADsSecurityUtility' is not defined.

Dim AD As activeds.ADsSecurityUtility
C:\Web\Permission_LookupV2(knowngood).aspx(25) : error BC30002: Type
'activeds.ADsSecurityUtility' is not defined.

AD = New activeds.ADsSecurityUtility

I noticed that the DLL in the registry, registered to CLSID with a GUID of
F270C64A-FFB8-4AE4-85FE-3A75E5347966 is neither version, it's version 0. I've
also ensured that the activeds.dll is the one I want running by deleting the
temp file in, at which point it calls the ActiveDS.dll that was found
in system32.

I'm really stuck on this problem. Below is my code. I would really
appreciate any help given as I've been working on this for weeks and have, as
of yet, been unable to find a solution. If anyone needs any clarification on
my problems, please let me know. If anyone wants my direct contact email,
feel free to ask.

thanks for the help in advance,



<%@ Import namespace="activeds" %>
<script language="VB" runat="Server">
Dim strcomputer As Object
Dim strabsolutefolderpath As String
Dim AD As activeds.ADsSecurityUtility
Dim adssecuritydescriptor As Object
Dim odacl As Object
Dim oace As Object
dim pdtest as object
Const ADS_PATH_FILE As Short = 1
Const ADS_SD_FORMAT_IID As Short = 1

'on error resume next

response.Write("<form method='get' 
response.Write("<input type='text' name='strabsolutefolderpath' size='18' 
response.Write("<input type='SUBMIT' value='Lookup'>")

strabsolutefolderpath = request.querystring.item("strabsolutefolderpath")

AD = New activeds.ADsSecurityUtility
adssecuritydescriptor = AD.GetSecurityDescriptor(strabsolutefolderpath, 
odacl = adssecuritydescriptor.DiscretionaryACL

If strabsolutefolderpath <> "" then
	response.write("FolderPath Entered is: " & "<strong>" & 
strabsolutefolderpath & "</strong><br>")
	response.Write(("<textarea size='20' rows=8 style='width: 730px' readonly>"))
	For	Each oace In odacl
		XEtest = left(oace.trustee,2)
		if XETest = "XE" then
			response.Write("User is: " & oace.Trustee)
			response.Write("activedss: ")
			If oace.Trustee = "XE\XE_FILE SECURITY_LIST" Then
				response.Write("PD\PD_GG_FILE SECURITY_LIST")
			ElseIf oace.AccessMask = 1245631 Then 
				response.Write(("Group Has Modify Rights"))
			ElseIf oace.AccessMask = 1179817 Then 
				response.Write(("Group Has Read Rights"))
			ElseIf oace.AccessMask = 2032127 Then 
				response.Write(("Group has Full Control"))

			ElseIf oace.AccessMask = 1507839 Then 
				response.Write(("Group has Help Desk Full Control"))

				response.Write(("Group Unknown, OACE: " & oace.accessmask))
			End If
		end if

	Next oace
end if

Last edited by a moderator:
Top Bottom