LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Authenticating against a Windows Domain using IADsOpenDSObject, returns error 3008

I'm trying to use the IADsOpenDSObject.OpenDSObject method to authenticate against a Windows domain.  I've seen several examples of this in VisualBasic and C.  I use the "Open Automation" object to create a refnum for the ActiveX class ActiveDs.IADsOpenDSObject which I found in the type library "Active DS Type Library Version 1.0" when selecting my ActiveX class.  The VI is as follows and is attached:

 

OpenDSObject.jpg

 

I receive the following error when I try to run the VI, after apply the appropriate input:

 

Error 3008 occured at Automation Interface for the specified class cannot be obtained. Check if the automation refnum type is the correct class for this operation in Untitled1.vi This error code is undefined. No one has provided a description for this code, or you might have wired a number that is not an error code to the error code input.

 

 

I've read several related posts and am lead to the conclusion that, since this is not a creatable class that I need to find a class that implements this interface, create that class, then cast this interface onto it.  I created that following VI to test the casting and it seems to work:

 

InterfaceCasting.jpg

 

This seems to work and does not generate an error.  Now, my assumption is that I would use the IADsOpenDSObject.OpenDSObject class as the type for the "Type Cast" object and open some mystery class for the "Open Automation" object, then attempt to implement the IADsOpenDSOjbect method and everything would be fine.  However, I cannot find a proper class to open for the "Open Automation", or at least all the ones I've tried have not yeilded the desired result.

 

QUESTIONS:

 

1) If this is the correct approach, what class implements the "IADsOpenDSObject" interface and would be the correct one to use?

 

2) If this is not the correct approach, can you suggest an approach for authenticating against a domain that would work in LabVIEW 6.1?

 

I've been able to use LabVIEW 8.6 and .Net and I can authenticate easily.  However, going the ActiveX route has posed a considerable challenge.  Any help would be greatly appreciated.

 

Download All
0 Kudos
Message 1 of 3
(4,037 Views)
The .NET method is by far the easiest way to do this. All of the examples I've seen related to using Win32 start with a GetObject (VB) function or ADGetObject (C) function. I don't think there's a way to call these from LabVIEW since you're dealing with pointers to pointers. I think if you have to get this working with LabVIEW 6.1 then your best bet is to simply create a simple DLL to perform the actual operation and have it return something like a Boolean to indicate whether the user is authenticated.
0 Kudos
Message 2 of 3
(4,014 Views)

Thank you for the suggestion.  I am considering this approach, however I was hoping there would be a LabVIEW approach that would work.  I'm trying to avoid writing another DLL because there is additional paperwork, licensing, installation issues, maintenance, etc... that goes with that.  Just trying to keep it simple.

 

Thanks again and if there is anybody out there who might know a LabVIEW solution, please reply.

0 Kudos
Message 3 of 3
(4,011 Views)